I'm trying to get to grips with XSLT and it's certainly a challenge. I've read lots of forum posts and watched videos but cannot create a relatively simple list.
Within a main section on my site I would like to list all the subsections and then present their child articles as a nested list. I have managed to present the subsections but the child articles are not being grouped within their subsections. At the moment the child articles are listed in all subsections.
How can I group them? Here is my code:
<xsl:template match="/">
<xsl:for-each select="$currentPage/descendant::Subsection [@isDoc and string(umbracoNaviHide) != '1']">
I've managed to get the list using various forum topics but particularly Dougs advice above. However in his example all items are listed in li tags as links.
I would like to style level 3 Items with a h2 tag and the child nodes with an anchor tag. Is it possible to write an if statement for example; if level 3 then <h2>...</h2>, if level 4 then <li><a>...</a></li>?
List subsections and their child articles
I'm trying to get to grips with XSLT and it's certainly a challenge. I've read lots of forum posts and watched videos but cannot create a relatively simple list.
Within a main section on my site I would like to list all the subsections and then present their child articles as a nested list. I have managed to present the subsections but the child articles are not being grouped within their subsections. At the moment the child articles are listed in all subsections.
How can I group them? Here is my code:
I'm guessing I need to add something here:
but every example I look at seems to offer a different solution.
thanks, Eddy
http://our.umbraco.org/forum/developers/xslt/1542-List-entire-structure-from-changeable-source
I'm now following Doug's advice.
I've managed to get the list using various forum topics but particularly Dougs advice above. However in his example all items are listed in li tags as links.
I would like to style level 3 Items with a h2 tag and the child nodes with an anchor tag. Is it possible to write an if statement for example; if level 3 then <h2>...</h2>, if level 4 then <li><a>...</a></li>?
Heres my code:
Any help really appreciated as I'm slowly losing the will to live.
thanks.
just above
Add something like
And just after </a>:
You'll probably need to play with the levels (which level corresponds with wich heading)
Thank for the tip Rik however it breaks with the error:
System.Xml.XmlException: Das 'h2'-Anfangstag in Zeile '38' stimmt nicht mit dem Endtag von 'xsl:when' überein. Zeile 39, Position 3.
the h2 tag doen't match the </xsl:when> tag.
I got it working using the code below. Thanks for the assistance!
is working on a reply...