Details
-
Improvement
-
Resolution: Obsolete
-
Trivial
-
None
-
2.1.3
-
None
Description
The attached files create a new cms:contentIterator tag and demonstrate its usage to create a Google Sitemap or OPML outline of the active page and all children. For this the files opml.jspx and sitemap.jspx should preferably be used as SubTemplates.
In addition to the attached tag implementation the following lines have to be added to the respective files.
info.magnolia.cms.util.Resource:
/**
- Set the request's <code>actpage</code> attribute to <code>page</code>
*/
public static void setCurrentActivePage(HttpServletRequest request, Content page) { request.setAttribute(Aggregator.CURRENT_ACTPAGE, page); }
/**
- Restores the request's original <code>actpage</code> attribute
- (i.e. the one specified by the request URI).
*/
public static void restoreCurrentActivePage(HttpServletRequest request) { setCurrentActivePage(request, getActivePage(request)); }
cms-taglib.tld:
<tag>
<name>contentIterator</name>
<tag-class>info.magnolia.cms.taglibs.ContentIterator</tag-class>
<body-content>JSP</body-content>
<description>iterate over Content collection</description>
<attribute>
<name>hiddenAttribute</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>If a page contains a boolean property with this name and it is set to true,
the page is skipped by the iterator. Defaults to "hidden".</description>
</attribute>
</tag>