Counting children nodes descriminating by doc type
I have a fairly normal umbraco tree structure of document types which get looped through to build a menu and this is all OK. However I have made a doc type called "MasterLinks" which contains a doc type "LinkGroup" which contains "Links" - the idea here being that an xslt on the temaplate for the Masterlinks page will write out a nicely formatted group of links as strucutered by the child docs.
My problem is this structure is being called out in my main menu - there are a lot of links here. An instead of settign umbraconaviHide on all the children [and training and getting the end user to remember to set this] I want to ignore all the children of the children of the MasterLinks doc [I don't want this page to be hidden so I can't simple umbraconaviHide on this Document Type]
This is the If that decides if I am going to call the template.
Tried things like name != "LinkGroup" but it seems to not affect the result.
<xsl:if test="count(child::*[@isDoc] /* [string(umbracoNaviHide) != '1' and name!= "LinkGroup"]) > 0 and $currentPage/ancestor-or-self::*/@id = @id">
You could use @nodeType and match it to the node ID for the LinkGroup document type. It wouldn't be the most flexible solution if you're moving it across installations but for a one-off it should do the job.
<xsl:if test="count(child::*[@isDoc] /* [string(umbracoNaviHide) != '1' and @nodeType!= ##THE ID## ]) > 0 and $currentPage/ancestor-or-self::*/@id = @id">
Counting children nodes descriminating by doc type
I have a fairly normal umbraco tree structure of document types which get looped through to build a menu and this is all OK. However I have made a doc type called "MasterLinks" which contains a doc type "LinkGroup" which contains "Links" - the idea here being that an xslt on the temaplate for the Masterlinks page will write out a nicely formatted group of links as strucutered by the child docs.
My problem is this structure is being called out in my main menu - there are a lot of links here. An instead of settign umbraconaviHide on all the children [and training and getting the end user to remember to set this] I want to ignore all the children of the children of the MasterLinks doc [I don't want this page to be hidden so I can't simple umbraconaviHide on this Document Type]
This is the If that decides if I am going to call the template.
Tried things like name != "LinkGroup" but it seems to not affect the result.
<xsl:if test="count(child::*[@isDoc] /* [string(umbracoNaviHide) != '1' and name!= "LinkGroup"]) > 0 and $currentPage/ancestor-or-self::*/@id = @id">
<ul>
<xsl:call-template name="drawNodes">
<xsl:with-param name="parent" select="."/>
</xsl:call-template>
</ul>
</xsl:if>
Hi Jamie,
You could use @nodeType and match it to the node ID for the LinkGroup document type. It wouldn't be the most flexible solution if you're moving it across installations but for a one-off it should do the job.
<xsl:if test="count(child::*[@isDoc] /* [string(umbracoNaviHide) != '1' and @nodeType!= ##THE ID## ]) > 0 and $currentPage/ancestor-or-self::*/@id = @id">
Tom
Tom,
It's the sort of 'problem' I can see reoccuring, would be nice to get a more flexible solution.
This page
http://our.umbraco.org/wiki/reference/xslt/45-xml-schema/xslt-examples-updated-to-new-schema
gives the following
For Each child node excluding a specfic Document Type Alias
New
select="$currentPage/*[not(self::NewsItem)]">
But I can't seem to get the not clause integrated with my statement.
Perhapse my best option is to add and attribute hideChildren to the main masterLinks node and check for that?
is working on a reply...