code du main_template
Ne passe pas à la coloration syntaxique (sorry)
<metal:page define-macro="master">
<metal:block use-macro="here/global_defines/macros/defines" />
<tal:globalAndCacheHeaders define="charset site_properties/default_charset|string:utf-8;
lang default_language|default;
results python:request.get('item',here.portal_catalog.searchResults(modified_usage='range:min',
sort_on='modified',
sort_order='reverse',
effective={'query':DateTime(),'range':'max'},
expires={'query':DateTime(),'range':'min'},
review_state=('published','announced'))[:1]);
lastPublishedDate python:str(results[0].modified.toZone('GMT').rfc822()).replace('+0000','GMT');
ifModifiedDate python:test(here.REQUEST.HTTP_IF_MODIFIED_SINCE is not None, here.REQUEST.HTTP_IF_MODIFIED_SINCE,'');
ifNoneMatch python:test(here.REQUEST.HTTP_IF_NONE_MATCH is not None, here.REQUEST.HTTP_IF_NONE_MATCH,'');
objEtag python: here.http__etag();
isNotModified python:test(lastPublishedDate == ifModifiedDate,1,0);
isMatching python:test(objEtag == ifNoneMatch,1,0);
noHttpCache python:test(isNotModified==0 or isMatching==0,1,0);">
<tal:block condition="python:isAnon and noHttpCache==1">
<metal:block tal:define="dummy python:request.RESPONSE.setHeader('Etag', objEtag)" />
<metal:block tal:define="dummy python:request.RESPONSE.setHeader('Content-Type', 'text/html;;charset=%s' % charset)" />
<metal:block tal:define="dummy python:request.RESPONSE.setHeader('Content-Language', lang)" />
<metal:block tal:define="dummy python:request.RESPONSE.setHeader('Last-Modified', lastPublishedDate)" />
<metal:block tal:define="dummy python:request.RESPONSE.setHeader('Cache-control', 'max-age=3600,must-revalidate,private')" />
<metal:block tal:define="dummy python:request.RESPONSE.setHeader('Vary', 'Accept-Language,Cookie,Accept-Encoding')" />
</tal:block>
<tal:block condition="not:isAnon">
<metal:block tal:define="dummy python:request.RESPONSE.setHeader('Content-Type', 'text/html;;charset=%s' % charset)" />
<metal:block tal:define="dummy python:request.RESPONSE.setHeader('Content-Language', lang)" />
<metal:block tal:define="dummy python:request.RESPONSE.setHeader('Last-Modified', str(DateTime().toZone('GMT').rfc822()).replace('+0000','GMT'))" />
<metal:block tal:define="dummy python:request.RESPONSE.setHeader('Vary', 'Accept-Language,Cookie,Accept-Encoding')" />
<metal:block tal:define="dummy python:request.RESPONSE.setHeader('Cache-control', 'must-revalidate,max-age=0,no-cache')" />
<metal:block tal:define="dummy python:request.RESPONSE.setHeader('Pragma', 'no-cache')" />
<metal:block tal:define="dummy python:request.RESPONSE.setHeader('Expires', 'Sat, 1 Jan 2000 00:00:00 GMT')" />
</tal:block>
<tal:cachePage condition="python: noHttpCache==0 and isAnon">
<metal:block tal:define="dummy python:request.RESPONSE.setStatus(304)" />
</tal:cachePage>
<tal:noCache condition="python: noHttpCache==1 or not isAnon">
<metal:doctype define-slot="doctype"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"></metal:doctype>
<metal:block define-slot="top_slot" />
<html xmlns="http://www.w3.org/1999/xhtml"
xml:lang="en"
lang="en"
tal:attributes="lang default_language|default;
xml:lang default_language|default;">
<head metal:use-macro="here/header/macros/html_header">
<metal:fillbase fill-slot="base">
<metal:baseslot define-slot="base">
<base href="" tal:attributes="href here/renderBase" />
</metal:baseslot>
</metal:fillbase>
<metal:headslot fill-slot="head_slot"
tal:define="language here/Language;
lang language | default_language;
charset site_properties/default_charset|string:utf-8">
<metal:headslot define-slot="head_slot" />
<!-- A slot where you can insert elements in the header from a template -->
</metal:headslot>
<metal:cssslot fill-slot="css_slot">
<!-- A slot where you can insert CSS in the header from a template -->
<metal:cssslot define-slot="css_slot" />
</metal:cssslot>
<metal:javascriptslot fill-slot="javascript_head_slot">
<!-- A slot where you can insert javascript in the header from a template -->
<metal:javascriptslot define-slot="javascript_head_slot" />
</metal:javascriptslot>
</head>
<body>
<div id="visual-portal-wrapper">
<div id="portal-top" i18n:domain="plone" >
<a class="hiddenStructure"
tal:define="url request/VIRTUAL_URL|string:${request/SERVER_URL}${request/PATH_TRANSLATED}"
tal:attributes="href string:${url}#documentContent"
i18n:translate="label_skiptocontent">Skip to content.</a>
<a metal:use-macro="here/global_logo/macros/portal_logo">
The portal logo, linked to the portal root
</a>
<div metal:use-macro="here/global_skinswitcher/macros/skin_tabs">
The skin switcher tabs. Based on which role you have, you
get a selection of skins that you can switch between.
</div>
<div metal:use-macro="here/global_siteactions/macros/site_actions">
Site-wide actions (Contact, Sitemap, Help, Style Switcher etc)
</div>
<div metal:use-macro="here/global_searchbox/macros/quick_search">
The quicksearch box, normally placed at the top right
</div>
<div metal:use-macro="here/global_sections/macros/portal_tabs">
The global sections tabs. (Welcome, News etc)
</div>
<div metal:use-macro="here/global_personalbar/macros/personal_bar">
The personal bar. (log in, logout etc...)
</div>
<div metal:use-macro="here/global_pathbar/macros/path_bar">
The breadcrumb navigation ("you are here")
</div>
</div>
<div class="visualClear"></div>
<!-- The wrapper table. It contains the three columns. There's a table-less
alternative in the plone_tableless skin layer that you can use if you
prefer layouts that don't use tables. -->
<table id="portal-columns">
<tbody>
<tr>
<!-- start of the left (by default at least) column -->
<td id="portal-column-one"
metal:define-slot="column_one_slot"
tal:condition="slots_mapping/left">
<div class="visualPadding">
<metal:leftportlets use-macro="here/portlets_fetcher/macros/left_column">
This instruction gets the portlets (boxes) for the left column.
</metal:leftportlets>
</div>
</td>
<!-- end of the left (by default at least) column -->
<!-- start of main content block -->
<td id="portal-column-content"
tal:define="tabindex python:Iterator(pos=0)">
<div id="content"
tal:define="show_border is_editable;"
tal:attributes="class python:test(show_border,'documentEditable','')">
<metal:ifborder tal:condition="show_border" >
<div metal:use-macro="here/global_contentviews/macros/content_views">
The content views (View, Edit, Properties, Workflow)
</div>
<div metal:use-macro="here/global_contentviews/macros/content_actions">
The content bar
</div>
</metal:ifborder>
<div class="documentContent">
<a name="documentContent"></a>
<div metal:use-macro="here/global_statusmessage/macros/portal_message">
Portal status message
</div>
<metal:header metal:define-slot="header" tal:content="nothing">
Visual Header
</metal:header>
<metal:bodytext metal:define-slot="main" tal:content="nothing">
Page body text
</metal:bodytext>
<metal:sub metal:define-slot="sub">
<metal:discussion use-macro="here/viewThreadsAtBottom/macros/discussionView" />
</metal:sub>
</div>
</div>
</td>
<!-- end of main content block -->
<!-- start of right (by default at least) column -->
<td id="portal-column-two"
metal:define-slot="column_two_slot"
tal:condition="slots_mapping/right">
<div class="visualPadding">
<metal:rightportlets metal:use-macro="here/portlets_fetcher/macros/right_column">
This instruction gets the portlets (boxes) for the right column.
</metal:rightportlets>
</div>
</td>
<!-- end of the right (by default at least) column -->
</tr>
</tbody>
</table>
<!-- end column wrapper -->
<div class="visualClear"> </div>
<hr class="netscape4" />
<div id="portal-footer" metal:use-macro="here/footer/macros/portal_footer">
Footer
</div>
<div id="portal-colophon" metal:use-macro="here/colophon/macros/colophon">
The colophon area - contains details about the production of
the site. Typically "powered by" buttons, standards, tools used.
</div>
</div>
</body>
</html>
</tal:noCache>
</tal:globalAndCacheHeaders>
</metal:page>







