Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • wadew 10 posts 20 karma points
    Feb 08, 2009 @ 09:04
    wadew
    0

    Site Navigation

    Hello,

    I would like to list the pages in to a list (ul li) for the navigation of the site.

    I am a noob to Umbraco. As i have just being using wordpress for my websites but i found umbraco and i find it a lot more flexible and a more capable cms system.

    I had a look at the XSLT and macros but i couldn't figure it out how to get it to work lol.

    If someone could help me i would like to thank them in advance.

    Btw my content structure is

    Thanks,
    Wade

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Feb 08, 2009 @ 11:15
    Dirk De Grave
    0

    Hi,

    welcome to umbraco.

    Here's a short how-to to get navigation on the 'Bluu' page:

    - Go to 'Developer' section, right-click 'Xslt' and select 'Create'.
    - Choose 'Navigation' as name and select 'List Sub Pages From Current Page'.
    - Check 'Create macro' as well.
    - Click 'Create'.
    - Expand 'Macro' node in the 'Developer' section, you should get a 'Navigation' macro.
    - Go to the template for the 'Bluu' page (if not sure which one that is, select the page and check the properties). Insert macro to the template using the icon dialogs on in the icon bar.
    - Browse to the 'Bluu' page and you should have the navigation of the site from the current page

    From there on, you could modify the xslt to suit your needs.. Be sure to check out the other 'xslt templates' as well. For example, the 'Navigation prototype' goes one step further and creates a navigation based on the complete site construct, as opposed to the one you've selected above, whcih does only list sub pages of the current selected page. It all depends on how you'd want your navigation to look like.

    Feel free to ask more questions.

    Regards,
    /Dirk

  • wadew 10 posts 20 karma points
    Feb 08, 2009 @ 18:55
    wadew
    0

    Wow that simple thanks so much :)

  • Amigo 243 posts 568 karma points
    Aug 31, 2010 @ 17:07
    Amigo
    0

    cool i use this as a topnavigation aswell, but it dosent show on my subpages? Only my hardcoded "Home" link...


    xslt:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <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"
     exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">

    <xsl:output method="xml" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>

    <xsl:template match="/">

    <!-- The fun starts here -->
    <ul>
     <li> <a href="/"><xsl:text>Home</xsl:text></a></li>
    <xsl:for-each select="$currentPage/* [@isDoc 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>

Please Sign in or register to post replies

Write your reply to:

Draft