[MAGNOLIA-624] New cms:contentIterator Tag and usage examples Created: 26/Jan/06  Updated: 19/Jan/09  Resolved: 19/Jan/09

Status: Closed
Project: Magnolia
Component/s: taglibs
Affects Version/s: 2.1.3
Fix Version/s: None

Type: Improvement Priority: Trivial
Reporter: Andreas Brenk Assignee: Fabrizio Giustina
Resolution: Obsolete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Java Source File ContentIterator.java     File opml-outline.jspx     File opml.jspx     File sitemap-url.jspx     File sitemap.jspx    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:

 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>



 Comments   
Comment by Andreas Brenk [ 26/Jan/06 ]

The tag implementation.

Comment by Andreas Brenk [ 26/Jan/06 ]

The Google Sitemap usage example.

Comment by Andreas Brenk [ 26/Jan/06 ]

The OPML usage example.

Comment by Magnolia International [ 19/Jan/09 ]

I'm closing this, assuming this is entirely possible with the current tag libraries. If not, feel free to reopen.

Generated at Mon Feb 12 03:19:16 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.