I'm having a bit of a problem trying to display a list of pages by the document type (baseArticlePage) without taking into account what the active page is. No matter what, I can't get it to display those pages except with the sitemap script thats included with Umbraco. I've checked the forums and tried to google to get some answers with no luck.
The script i'm trying to use is this (also comes with Umbraco):
Problems getting pages by document type
Hi all!
I'm having a bit of a problem trying to display a list of pages by the document type (baseArticlePage) without taking into account what the active page is. No matter what, I can't get it to display those pages except with the sitemap script thats included with Umbraco. I've checked the forums and tried to google to get some answers with no luck.
The script i'm trying to use is this (also comes with Umbraco):
<?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" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:autofolders.library="urn:autofolders.library"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets autofolders.library ">
<xsl:output method="xml" omit-xml-declaration="yes" />
<xsl:param name="currentPage"/>
<!-- Input the documenttype you want here -->
<xsl:variable name="documentTypeAlias" select="string('baseArticlePage')"/>
<xsl:template match="/">
<!-- The fun starts here -->
<ul>
<xsl:for-each select="$currentPage/* [name() = $documentTypeAlias and string(umbracoNaviHide) != '1']">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
</li>
</xsl:for-each>
</ul>
</xsl:template>
</xsl:stylesheet>
Hi Mattias,
If you try this you can get the documentType:
<xsl:value-of select="$currentPage/@nodeTypeAlias"/>
nodeTypeAlias is a property on the currentpage that can give you what you want.
Sajid
is working on a reply...