Copied to clipboard

Flag this post as spam?

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


  • Streety 358 posts 568 karma points
    Feb 03, 2011 @ 17:16
    Streety
    0

    RelatedLinksList.xslt

    The RelatedLinksList.xslt file looks at the homepage primary navigation tab for its nodes to display in the menu.

    Please excuse my poor xslt BUT I can't seem to figure how this is linked in.

        <xsl:variable name="homepage" select="$currentPage/ancestor-or-self::Homepage"/>
        <xsl:variable name="nodeIds" select="umbraco.library:Split($homepage/*[name()=$propertyAlias],',')" />

    Is it looking at the template name or document type. The top level document is called Home with a Homepage doc type and template.

    I would be interested how you pass the values from the primary navigation variable.

    I currently get nothing which means that I don't think the script is wired to look at the home page properly.

    My templates and doc type are called PageHome. Is this the problem?


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

      <xsl:param name="currentPage"/>
      <xsl:variable name="rootPage" select="$currentPage/ancestor-or-self::root"/>
      <xsl:variable name="propertyAlias" select="/macro/PropertyAlias"/>
      
      <xsl:template match="/">

        <xsl:variable name="homepage" select="$currentPage/ancestor-or-self::Homepage"/>
        <xsl:variable name="nodeIds" select="umbraco.library:Split($homepage/*[name()=$propertyAlias],',')" />

          <ul class="navigation fc">
            <xsl:for-each select="$nodeIds/value">
            <xsl:variable name="linkNone" select="$rootPage//*[@isDoc][@id = string(current()/.)]"/>
            <xsl:if test="string-length($linkNone/@id)> 0">
            <li>
                <xsl:attribute name="class">
                  <xsl:if test="$currentPage/ancestor-or-self::*[@level &gt; 1]/@id = $linkNone/@id">
                <xsl:text>selected</xsl:text>
                  </xsl:if>
                  <xsl:if test="position() = last()">
                    <xsl:text> last</xsl:text>
                  </xsl:if>

                </xsl:attribute>

              <xsl:choose>
                <xsl:when test="string-length($linkNone/umbracoUrlAlias) > 0">
                  <a href="{$linkNone/umbracoUrlAlias}">
                    <xsl:value-of select="$linkNone/@nodeName"/>
                  </a>
                </xsl:when>
                <xsl:otherwise>
                  <a href="{umbraco.library:NiceUrl($linkNone/@id)}">
                    <xsl:value-of select="$linkNone/@nodeName"/>
                  </a>
                </xsl:otherwise>
              </xsl:choose>
              
            </li>
            </xsl:if>
          </xsl:for-each>

          </ul>
      </xsl:template>

  • Streety 358 posts 568 karma points
    Feb 03, 2011 @ 18:44
    Streety
    0

    I have figured it out. Need to change the Homepage syntax to PageHome which is my doc type/template

     <xsl:variable name="homepage" select="$currentPage/ancestor-or-self::PageHome"/>
Please Sign in or register to post replies

Write your reply to:

Draft