Copied to clipboard

Flag this post as spam?

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


  • Chris Currie 1 post 21 karma points
    Jun 26, 2013 @ 15:29
    Chris Currie
    0

    Cannot get Umbraco navigation XSLT for pages in sub folder to work

    I know this should be simple but I really am useless with XSLT (I'm learning though...).

    I am building my first Umbraco site and have the dynamic navigation working for the top menu but I am failing on the footer menu (nothing is showing).

    The site structure is:

    Site (Master template - level 1)
        - Home (content page)
        - Candidates (content page)
        - Contact (content page)
        - Clients (content page)
        - Footer Pages (Container folder hidden from Nav - level 2)
             - Links
             - Terms and Conditions
             - Cookies
             - Privacy Policy

    I would have thought I could use more or less the same XSLT as the top menu (shown below) but use level 2 rather than level 1 but this is not working (nothing is pulled out):

        <?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"
          exclude-result-prefixes="msxml umbraco.library">    

            <xsl:output method="xml" omit-xml-declaration="yes" />
            <xsl:param name="currentPage"/>
            <xsl:variable name="level" select="1"/>    
            <xsl:template match="/">
         <ul id="topNavigation">
              <xsl:for-each select="$currentPage/ancestor-or-self::* [@level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']">
          <li>
             <xsl:if test="@id = $currentPage/@id">
                <xsl:attribute name="class">active</xsl:attribute>
              </xsl:if>
            <a class="navigation" href="{umbraco.library:NiceUrl(@id)}">
              <span><xsl:value-of select="@nodeName"/></span>
            </a>
          </li>    
        </xsl:for-each>
        </ul>    
        </xsl:template>
        </xsl:stylesheet>

    So I'm just trying to list out the footer pages of (Links | Terms & Conditions | Cookies | Privacy Policy)...

    Any guidence would be fantastic. Thanks!

    Here is the site XML:

        <?xml version="1.0" encoding="utf-8"?>

        <!DOCTYPE root[
        <!ELEMENT umbBlog ANY>
        <!ATTLIST umbBlog id ID #REQUIRED>
        <!ELEMENT umbBlogPost ANY>
        <!ATTLIST umbBlogPost id ID #REQUIRED>
        <!ELEMENT ContentFolder ANY>
        <!ATTLIST ContentFolder id ID #REQUIRED>
        <!ELEMENT DateFolder ANY>
        <!ATTLIST DateFolder id ID #REQUIRED>
        <!ELEMENT umbHomepage ANY>
        <!ATTLIST umbHomepage id ID #REQUIRED>
        <!ELEMENT umbNewsArea ANY>
        <!ATTLIST umbNewsArea id ID #REQUIRED>
        <!ELEMENT umbNewsArticle ANY>
        <!ATTLIST umbNewsArticle id ID #REQUIRED>
        <!ELEMENT Team24HomePage ANY>
        <!ATTLIST Team24HomePage id ID #REQUIRED>
        <!ELEMENT Team24InnerPage ANY>
        <!ATTLIST Team24InnerPage id ID #REQUIRED>
        <!ELEMENT Team24MasterPage ANY>
        <!ATTLIST Team24MasterPage id ID #REQUIRED>
        <!ELEMENT umbTextpage ANY>
        <!ATTLIST umbTextpage id ID #REQUIRED>
        <!ELEMENT umediaSlider ANY>
        <!ATTLIST umediaSlider id ID #REQUIRED>
        <!ELEMENT umediaSliders ANY>
        <!ATTLIST umediaSliders id ID #REQUIRED>  
        ]>

        <root id="-1">
          <Team24MasterPage id="1120" parentID="-1" level="1" creatorID="0" sortOrder="3" createDate="2013-06-26T11:06:54" updateDate="2013-06-26T11:21:36" nodeName="Team 24 Site" urlName="team-24-site" path="-1,1120" isDoc="" nodeType="1119" creatorName="admin" writerName="admin" writerID="0" template="0">

            <Team24HomePage id="1096" parentID="1120" level="2" creatorID="0" sortOrder="0" createDate="2013-06-20T00:33:15" updateDate="2013-06-26T11:28:37" nodeName="Home" urlName="home" path="-1,1120,1096" isDoc="" nodeType="1092" creatorName="admin" writerName="admin" writerID="0" template="1093">
              <homepagePageTitle>Team 24 Home Page</homepagePageTitle>
              <homepageMetaDescription>Description of the page goes here</homepageMetaDescription>
              <homepageMetaKeywords>keywords,go,here</homepageMetaKeywords>
              <homepageHeading1>Homepage Header Goes Here</homepageHeading1>
            </Team24HomePage>

            <Team24InnerPage id="1103" parentID="1120" level="2" creatorID="0" sortOrder="1" createDate="2013-06-21T01:46:07" updateDate="2013-06-26T12:25:51" nodeName="Candidates" urlName="candidates" path="-1,1120,1103" isDoc="" nodeType="1094" creatorName="admin" writerName="admin" writerID="0" template="1095">
              <pageTitle>Candidates</pageTitle>
              <metaDescription>Meta Description Goes Here</metaDescription>
              <metaKeywords>keywords,go,here</metaKeywords>
              <innerPageHeading1>Candidates</innerPageHeading1>
              <innerPageHeading2 />
            </Team24InnerPage>

            <Team24InnerPage id="1105" parentID="1120" level="2" creatorID="0" sortOrder="2" createDate="2013-06-21T01:47:44" updateDate="2013-06-26T11:25:04" nodeName="Contact" urlName="contact" path="-1,1120,1105" isDoc="" nodeType="1094" creatorName="admin" writerName="admin" writerID="0" template="1095">
              <pageTitle>Contact</pageTitle>
              <metaDescription>Meta Description Goes Here</metaDescription>
              <metaKeywords>keywords,go,here</metaKeywords>
              <innerPageHeading1>Contact</innerPageHeading1>
              <innerPageHeading2 />
            </Team24InnerPage>

            <Team24InnerPage id="1102" parentID="1120" level="2" creatorID="0" sortOrder="3" createDate="2013-06-21T00:58:03" updateDate="2013-06-26T11:25:04" nodeName="Clients" urlName="clients" path="-1,1120,1102" isDoc="" nodeType="1094" creatorName="admin" writerName="admin" writerID="0" template="1095">
              <pageTitle>Clients</pageTitle>
              <metaDescription>Meta Description Goes Here</metaDescription>
              <metaKeywords>keywords,go,here</metaKeywords>
              <innerPageHeading1>Clients</innerPageHeading1>
              <innerPageHeading2 />
            </Team24InnerPage>

            <ContentFolder id="1112" parentID="1120" level="2" creatorID="0" sortOrder="4" createDate="2013-06-26T09:53:08" updateDate="2013-06-26T11:25:04" nodeName="Footer Pages" urlName="footer-pages" path="-1,1120,1112" isDoc="" nodeType="1111" creatorName="admin" writerName="admin" writerID="0" template="0">

              <Team24InnerPage id="1116" parentID="1112" level="3" creatorID="0" sortOrder="12" createDate="2013-06-26T09:54:25" updateDate="2013-06-26T11:21:37" nodeName="Links" urlName="links" path="-1,1120,1112,1116" isDoc="" nodeType="1094" creatorName="admin" writerName="admin" writerID="0" template="1095">
                <pageTitle>Links</pageTitle>
                <metaDescription>Meta Description Goes Here</metaDescription>
                <metaKeywords>keywords,go,here</metaKeywords>
                <innerPageHeading1>Links</innerPageHeading1>
                <innerPageHeading2 />
              </Team24InnerPage>

              <Team24InnerPage id="1115" parentID="1112" level="3" creatorID="0" sortOrder="13" createDate="2013-06-26T09:54:11" updateDate="2013-06-26T11:21:37" nodeName="Terms &amp;amp; Conditions" urlName="terms-amp-conditions" path="-1,1120,1112,1115" isDoc="" nodeType="1094" creatorName="admin" writerName="admin" writerID="0" template="1095">
                <pageTitle>Terms and Conditions</pageTitle>
                <metaDescription>Meta Description Goes Here</metaDescription>
                <metaKeywords>keywords,go,here</metaKeywords>
                <innerPageHeading1>Terms and Conditions</innerPageHeading1>
                <innerPageHeading2 />
              </Team24InnerPage>

              <Team24InnerPage id="1114" parentID="1112" level="3" creatorID="0" sortOrder="14" createDate="2013-06-26T09:53:54" updateDate="2013-06-26T11:21:37" nodeName="Cookies" urlName="cookies" path="-1,1120,1112,1114" isDoc="" nodeType="1094" creatorName="admin" writerName="admin" writerID="0" template="1095">
                <pageTitle>Cookies</pageTitle>
                <metaDescription>Meta Description Goes Here</metaDescription>
                <metaKeywords>keywords,go,here</metaKeywords>
                <innerPageHeading1>Cookies</innerPageHeading1>
                <innerPageHeading2 />
              </Team24InnerPage>

              <Team24InnerPage id="1113" parentID="1112" level="3" creatorID="0" sortOrder="15" createDate="2013-06-26T09:53:44" updateDate="2013-06-26T11:21:37" nodeName="Privacy Policy" urlName="privacy-policy" path="-1,1120,1112,1113" isDoc="" nodeType="1094" creatorName="admin" writerName="admin" writerID="0" template="1095">
                <pageTitle>Privacy Policy</pageTitle>
                <metaDescription>Meta Description Goes Here</metaDescription>
                <metaKeywords>keywords,go,here</metaKeywords>
                <innerPageHeading1>Privacy Policy</innerPageHeading1>
                <innerPageHeading2 />
              </Team24InnerPage>

              <umbracoRedirect />
              <umbracoNaviHide>1</umbracoNaviHide>
            </ContentFolder>

            <footerLinkedinLink>http://www.linkedin.com/profile/view?id=8209529&amp;locale=en_US&amp;trk=tyah</footerLinkedinLink>;
            <headerTelephoneNumber>0845 370 2424</headerTelephoneNumber>
          </Team24MasterPage>

        </root>

Please Sign in or register to post replies

Write your reply to:

Draft