[MAGNOLIA-226] Improve tag libraries Created: 30/Nov/04  Updated: 23/Jan/13  Resolved: 23/Jan/05

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

Type: Improvement Priority: Major
Reporter: Hugo Lumsdon Assignee: Fabrizio Giustina
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

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 Magnolia tag libraries need aligning much closer to JSTL (/EL).

In particular <cms:out> should be depreciated in favour of <c:out>. <c:out> offers the ability to escape XML entities which is invaluable if writing out XHTML or XML pages. None of the Magnolia tags seem to offer the ability to escape XML.

For example the following is not desirable:

<c:set var="lineAbove"><cms:out nodeDataName="lineAbove"/></c:set>

It would be much better to expose the current node data as a bean, so we could do the following:

<c:if test="${currentNode.lineAbove}">.....</c:if>

A solution may be to create a <cms:getCurrentNode> tag which exposes a bean representing the current node being iterated in the page context:

<cms:getCurrentNode var="currentNode"/>

<c:if test="${!empty currentNode.title}">
<c:out value="${currentNode.title}"/>
</c:if>

This would be far more compliant and tidier than the current solution and also enable us to produce XHTML compliant pages!



 Comments   
Comment by Boris Kraft [ 30/Nov/04 ]

Sounds good, please submit a patch.

Comment by Fabrizio Giustina [ 23/Jan/05 ]

added to svn:
the name of the tag is "setNode" (for consistence with JSTL "set" tag). Note that this tag does not only expose the current node, but it also wraps the content node using a Map which allows accessing nodedatas as map properties.
Apart from the name of the tag, your example should work fine.
See http://magnolia.sourceforge.net/maven/tagreference-cms-taglib.html#setNode for the documentation

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