Hi Ralf

Thanks for the reply. Three quick follow-up questions though:

1. Why does <cms:ifNotEmpty /> behave differently than <cms:out />?
2. The description for "actpage" is missing in the taglib reference (http://magnolia.sourceforge.net/30/magnolia-taglib-cms/ tagreference.html#ifNotEmpty). What does it do exactly? 3. If I add actpage="true" it will work for displaying attributes of the current page. I'm affraid though that it will not work anymore when I use the same template to display attributes of a list of pages that I iterate over (<cms:contentNodeIterator items="$ {myPageList}">...</cms:contentNodeIterator). <cms:out /> does work in both cases!

One possible solution would be:

<cms:out nodeDataName="myAttributeName" var="test" />
<c:if test="not empty test">
        Here's my value: <cms:out="myAttributeName" />
</c:if>

This should work in both cases... but it's a bit of a hack, wouldn't you agree?

Regards,
Will

On 12.02.2007, at 03:27, Ralf Hirning wrote:

Will,

Add actpage="true" to the tag and it works...

<cms:ifNotEmpty nodeDataName="my_page_attribute_name" actpage="true">
        Content of "my_page_attribute":
<cms:out nodeDataName="my_page_attribute_name" />
</cms:ifNotEmpty>

Ralf

-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:[EMAIL PROTECTED]
Gesendet: Sonntag, 11. Februar 2007 20:30
An: [email protected]
Betreff: [magnolia-user] <cms:ifNotEmpty> on page properties

Dear Magnolians

I would like to output some content that the user sets in the page
properties (like the page title and so on), but only, if it's not
empty. Strange enough if I test for

<cms:ifNotEmpty nodeDataName="my_page_attribute_name">
        Content of "my_page_attribute": <cms:out
nodeDataName="my_page_attribute_name" />
</cms:ifNotEmpty>

I never get anything. Although if I use <cms:out
nodeDataName="my_page_attribute_name" /> alone, it clearly shows,
that the node is not empty. Of course I could now do this:

<c:if test="${not empty pageProperties.my_page_attribute_name">
        Content of "my_page_attribute": <cms:out
nodeDataName="my_page_attribute_name" />
</c:if>

But this does not work for me either because I would like to use the
same jsp template on a page (displaying the page properties) _and_ in
a paragraph looping over multiple pages - so I cannot use
"pageProperties".

Is there a bug in <cms:ifNotEmpty /> or am I using it wrong?

Thanks!

Regards,
Will


----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------


----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------

Reply via email to