Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
This may seem like an odd request (it certainly does to me, but it's what the client wants!)
I need to list every page in the site alphabetically for an "A-Z" page (like a sitemap, but less helpful IMO).
I can't seem to work out how to do this.
I've got this far:
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE xsl:Stylesheet [ <!ENTITY nbsp " "> ]><xsl:stylesheetversion="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform"xmlns:msxml="urn:schemas-microsoft-com:xslt"xmlns:umbraco.library="urn:umbraco.library"exclude-result-prefixes="msxml umbraco.library"><xsl:output method="xml" omit-xml-declaration="yes" /><!-- Change this to root menu node - ie Home --><xsl:variable name="source" select="1046"/><xsl:template match="/"><xsl:call-template name="drawNodes"> <xsl:with-param name="parent" select="umbraco.library:GetXmlNodeById($source)"/></xsl:call-template></xsl:template><xsl:template name="drawNodes"> <xsl:param name="parent"/> <xsl:param name="startLevel" select="$parent/@level" /> <xsl:for-each select="$parent/node [string(data [@alias='umbracoNaviHide']) != '1']"><xsl:sort select="@nodeName" order="ascending" /> <li> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="@nodeName"/> </a> <!-- recursive calling of same template for childs --> <xsl:if test="count(./descendant::node) > 0"> <xsl:call-template name="drawNodes"> <xsl:with-param name="parent" select="."/> <xsl:with-param name="startLevel" select="$startLevel"/> </xsl:call-template> </xsl:if> </li> </xsl:for-each> </xsl:template></xsl:stylesheet>
...which lists the entire site, but sorts each set of childs separately - I need one long list sorted alphabetically.
Can anyone help? Many thanks, Olly
Try this:
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE xsl:Stylesheet [ <!ENTITY nbsp " ">]><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"xmlns:msxml="urn:schemas-microsoft-com:xslt" xmlns:umbraco.library="urn:umbraco.library"exclude-result-prefixes="msxml umbraco.library"> <xsl:output method="xml" omit-xml-declaration="yes" /> <!-- Change this to root menu node - ie Home --> <xsl:variable name="source" select="1046"/> <xsl:template match="/"> <xsl:for-each select="umbraco.library:GetXmlNodeById($source)/descendant-or-self::node [string(data [@alias='umbracoNaviHide']) != '1']"> <xsl:sort select="@nodeName" order="ascending" /> <li> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="@nodeName"/> </a> </li> </xsl:for-each> </xsl:template></xsl:stylesheet>
hth, Thomas
Beautiful Thomas, thank you so much. Seems so obvious now I see it!!
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
List entire site alphabetically?
This may seem like an odd request (it certainly does to me, but it's what the client wants!)
I need to list every page in the site alphabetically for an "A-Z" page (like a sitemap, but less helpful IMO).
I can't seem to work out how to do this.
I've got this far:
...which lists the entire site, but sorts each set of childs separately - I need one long list sorted alphabetically.
Can anyone help? Many thanks, Olly
Try this:
hth, Thomas
Beautiful Thomas, thank you so much. Seems so obvious now I see it!!
is working on a reply...