I've just begun building a site in Umbraco after using .NET for many years.
I'm trying to accomplish something which I am sure should be very simple.
This is to display a menu in the footer of my site, displaying a list of page links to pages which are children of a 'Footer' placeholder page which is not displayed in the main menu.
I published some dummy pages in the hierarchy Homepage > Footer > Test Page 1, etc.
Then I created a macro and an XSLT file to display a list of the pages at this location in the hierarchy.
Help needed
I've just begun building a site in Umbraco after using .NET for many years.
I'm trying to accomplish something which I am sure should be very simple.
This is to display a menu in the footer of my site, displaying a list of page links to pages which are children of a 'Footer' placeholder page which is not displayed in the main menu.
I published some dummy pages in the hierarchy Homepage > Footer > Test Page 1, etc.
Then I created a macro and an XSLT file to display a list of the pages at this location in the hierarchy.
In my master page:
1099 is the ID of the placeholder page.
In the macro's XSLT file:
But the output renders nothing more than an empty self-closing <ul /> tag, which breaks my page rendering.
Any ideas to help out a newbie? And how can I view the raw XML output of an XSLT file?
Thanks in advance!
I originally tried this code, with the same result:
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:variable name="startNodeId" select="/macro/startNodeId"/>
<xsl:template match="/">
<ul>
<xsl:for-each select="$currentPage/ancestor-or-self::* [@id=$startNodeId]/*">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:if test="$currentPage/@id = current()/@id">
<xsl:attribute name="class">selected</xsl:attribute>
</xsl:if>
<xsl:value-of select="@nodeName"/>
</a>
</li>
</xsl:for-each>
</ul>
</xsl:template>
Hi Tom - welcome to Umbraco :-)
The snippet you've got uses what's referred to as "the legacy XML schema" - change this:
to this:
To start getting your documents rendered.
Then search the forum for info about the new XML schema.
/Chriztian
Legend - how many hours did I spend on that?!? Thanks a million. Looking up the new schema now...
Tom
No worries - it's pure joy from now on :-) (Famous last words...)
BTW: Regarding the XML output - do yourself a favor and install XMLDump right away (In Developer/Packages > Developer Tools) - it'll help you tons!
/Chriztian
is working on a reply...