But what if i want to show the nodename of the parent.
I have tried with a for-each statement with the level of the 2009-node - but then when i add for instance year 2010, the for each show both years (of course)
Show us the complete xslt, so we can get hold of the context. It's quite easy to get the 2009 page from the August page, but it all depends how you get to the August page first? So, willing to share that bit of code?
It's a rather long xslt file. to sum up, i have a structure like this:
news page (My Macro is on this page!) ---- 2009 ----- august
---- 2010
----- september
And so on! On the news page i want to display the nodename of the August, September and all the other months/nodes above an image. This Works. But I would also like to show the correct year = so that it will displat August 2009 and September 2010.
The XSLT is probabably not "best practice" - but it works. Suggetions are appreciated though :)
<xsl:for-each select="$currentPage/descendant-or-self::node [@level=$level]/node [string(data [@alias='umbracoNaviHide']) != '1']"> <!-- THE IF, WILL TEST HOW MANY ITEMS TO SHOW --> <xsl:if test="position() <= $maxItems"> <h2>
<!-- Month - taken from the node name--> <xsl:value-of select="@nodeName" disable-output-escaping="yes"/>
<br /> <!-- THE DANISH PDF FILE OF THE NEWS MAGAZINE --> <!-- FIRST SHOW THE PDF LOGO FROM THE MEDIA LIBRARY --> <img> <xsl:attribute name="src"> <xsl:value-of select="umbraco.library:GetMedia(1497, 'false')/data [@alias = 'umbracoFile']"/> </xsl:attribute> </img> <!-- REMEMBER THE SPACE BETWEEN THE PDF LOGO AND THE LINK --> <!-- THEN SHOW THE LINK TO THE DANISH FILE --> <xsl:variable name="danishfile" select="umbraco.library:GetMedia(number(./data[@alias='BWnewsFileDanish']),'false')"/> <a href="{$danishfile/data[@alias='umbracoFile']}">In danish</a> </xsl:if> </xsl:for-each
Show only THE parent of the node
Hi,
I have a structure like this:
news
-- 2009
---- august
On the "August" page, i want to display the the month and year.
I show the month by nodename like this:
But what if i want to show the nodename of the parent.
I have tried with a for-each statement with the level of the 2009-node - but then when i add for instance year 2010, the for each show both years (of course)
But how to ONLY show THE parent of August?
best regards,
Brian
Hi Brian,
If you need a reference to the parent and display the node name, use
or
Also, take a look at this wiki page
Cheers,
/Dirk
Hi Dirk,
I confused my self a bit apparently!
My Macro is really on the News page. And on this page i want to show the parent of the August page - in this example the 2009 page.
Is that possible?
best regards
Brian
Hi Brian,
Show us the complete xslt, so we can get hold of the context. It's quite easy to get the 2009 page from the August page, but it all depends how you get to the August page first? So, willing to share that bit of code?
Cheers,
/Dirk
Hi Dirk,
It's a rather long xslt file. to sum up, i have a structure like this:
news page (My Macro is on this page!)
---- 2009
----- august
---- 2010
----- september
And so on!
On the news page i want to display the nodename of the August, September and all the other months/nodes above an image. This Works. But I would also like to show the correct year = so that it will displat August 2009 and September 2010.
The XSLT is probabably not "best practice" - but it works. Suggetions are appreciated though :)
Best regards,
Brian
Hi Brian,
It's like dirk said.
Cheers,
Nico
Hi Nico!
Thanks a bunch. Simple, simple, simple.
best regards
Brian
is working on a reply...