<!-- Input the documenttype you want here --> <!-- Typically '1' for topnavigtaion and '2' for 2nd level --> <!-- Use div elements around this macro combined with css --> <!-- for styling the navigation --> <xsl:variable name="level" select="1"/>
<xsl:template match="/">
<!-- The fun starts here --> <ul style="outline: 1px solid red; width: 10px; height: 10px;"> <xsl:for-each select="$currentPage/ancestor-or-self::* [@isDoc and @level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']"> <li> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:if test="$currentPage/ancestor-or-self::*/@id = current()/@id"> <!-- we're under the item - you can do your own styling here --> <xsl:attribute name="class">selected</xsl:attribute> </xsl:if> <xsl:value-of select="@nodeName"/> </a> </li> </xsl:for-each> </ul>
</xsl:template>
</xsl:stylesheet>
Any ideas to how I can get the script working and returning <li>´s as well ?
Not meaning to create you another problem, however unless 'Sprojtestobe' and ' NEK' are separate websites you should probably move them under a 'Home' Node, so your structure will look like this
Content
- Home
- Sprojtestobe
- NEK
- Any other new content
If you do this then and change the level to 2, you should get your li's listed.
I made the changes you suggested in the content tree and tried a few numbers for the level variable. Setting it to 1 gave me the <li>´s ! Yeeeeppiieeeh !! ;)
Navigation Prototype - can´t get it working.
Pretty new to umbraco and XSLT so go easy on me ;)
I´ve tried to use the Navigation Prototype XSLT script to try to create a single level menu.
After inserting the macro into the template the only thing the XSLT script returns is an empty set of <ul> </ul>-tags.
No <li>´s - but why ?
I´ve tried to change the value of the level variable but had no succes with it.
The content tree is pretty simple...
[content]
-[page1]
-[page2]
I´ve checked that umbracoNaviHide is not set for the pages and that it is defined as a boolean (True/False) in the document type.
Umbraco is version 4.5.2 with the new schema (snippet from umbracoSettings.config)
Here is what I´ve been working with - it´s close to the standard Navigation Prototype..
Any ideas to how I can get the script working and returning <li>´s as well ?
Hey Brian,
It depends what level your content is on, it certainly wont be on 0 so try changing it to 2
If that doesn't work then post an image of your content tree and we can figure it out.
Best of luck
Rich
Here is the content tree.
I´ve tried the levels 0, 1, 2, 3, 4 .. but still no luck.
Hi Brian,
Not meaning to create you another problem, however unless 'Sprojtestobe' and ' NEK' are separate websites you should probably move them under a 'Home' Node, so your structure will look like this
Content
- Home
- Sprojtestobe
- NEK
- Any other new content
If you do this then and change the level to 2, you should get your li's listed.
Rich
Ahaaaaa !
I made the changes in the content tree and tried a few numbers for the level variable. Setting it to 1 gave me the <li>´s ! Yeeeeppiieeeh !! ;)
Thanks for the quick reply Rich !
Ahaaaaa !
I made the changes you suggested in the content tree and tried a few numbers for the level variable. Setting it to 1 gave me the <li>´s ! Yeeeeppiieeeh !! ;)
Thanks for the quick reply Rich !
is working on a reply...