You are here: Home Website Toolkit Toolkit Documentation Center How-tos Last Update
Document Actions

Last Update

A Macro that displays when your Website was last updated

In the custom folder create a pagetemplate named global_lastupdate. Put the following code into it:

<html>
<body>
<div metal:define-macro="portlet"
tal:define="results python:here.portal_catalog.searchResults(sort_on='Date',
sort_order='reverse',
review_state='published')[:1];">
<tal:entry tal:repeat="result results">
<a tal:content="result/Date" tal:attributes="href string:${here/portal_url}/recently_published; title result/Title"> 2005-01-02 </a>
</tal:entry>
</div>
</body>
</html>

you may call this as a portlet by inserting 'here/global_lastupdate/macros/portlet' into the 'left_slots' or 'right_slots' properties of your portal or call it from any other pagetemplate with:

 <div metal:use-macro="here/global_lastupdate/macros/portlet"> Last Update of the site </div>

.


In partnership with: GEF IW:LEARN Project Coordinating Unit (PCU)
c/o UNDP Washington Office
1775 K St., NW, Suite 420
Washington, DC 20006, USA
unep@iwlearn.org
Phone:+1 703-835-9287 (TEK-WATR)
Fax: +1 702-552-6583
UNEP/DGEF IW:LEARN
P.O. Box 30552
Nairobi 00100, KENYA
unep@iwlearn.org
Phone: +254 20 7623271
Fax: +254 20 7624042