Copied to clipboard

Flag this post as spam?

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


  • René 327 posts 852 karma points
    Dec 19, 2012 @ 13:46
    René
    0

    Related Links

    Hi 

    I have an umbraco v 4.11.1 (Assembly version: 1.0.4715.27659) instalation 

    I try to get related links to work

    I have an XSLT file i have used several times, but now i vill not vork any more

    XSLT:

    <!-- Input the related links property alias here -->
      <xsl:variable name="propertyAlias" select="string('footerLinks')"/>
    
      <xsl:template match="/">
    
        <!-- The fun starts here -->
        <ul>
           <xsl:for-each select="$currentPage/ancestor-or-self::*[@level = 1]/*[name() = $propertyAlias]/links/link">
             <li>
              <xsl:element name="a">
                <xsl:if test="./@newwindow = '1'">
                  <xsl:attribute name="target">_blank</xsl:attribute>
                </xsl:if>
                <xsl:choose>
                  <xsl:when test="./@type = 'external'">
                    <xsl:attribute name="href">
                      <xsl:value-of select="./@link"/>
                    </xsl:attribute>
                  </xsl:when>
                  <xsl:otherwise>
                    <xsl:attribute name="href">
                      <xsl:value-of select="umbraco.library:NiceUrl(./@link)"/>
                    </xsl:attribute>
                  </xsl:otherwise>
                </xsl:choose>
                  <xsl:value-of select="./@title"/>
              </xsl:element>
            </li>
          </xsl:for-each>
        </ul>
    
        <!-- Live Editing support for related links. -->
        <xsl:value-of select="umbraco.library:Item($currentPage/@id,$propertyAlias,'')" />
    
      </xsl:template>
    
    When i test the XSLT it works
    <ul class="footer-items-list">
        <li>
            <a href="/">Hundefrisør</a>
        </li>
        <li>
            <a href="/">Hundesalon</a>
        </li>
        <li>
            <a href="/tidsbestilling.aspx">Tidsbestilling</a>
        </li>
    </ul>

    I get this output when i insert the macro into my template:

    <links>
        <link title="Hundefrisør" link="1056" type="internal" newwindow="0" />
        <link title="Hundesalon" link="1056" type="internal" newwindow="0" />
        <link title="Tidsbestilling" link="1080" type="internal" newwindow="0" />
    </links>

     

    Any ideas? 

    (I have been trying for hours now... i´m sure this is a small isue, but i cant see it)

     

    Tanks in advance. :-)

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Dec 19, 2012 @ 14:13
    Tim Geyssens
    0

    Are you sure you are outputting the correct macro since it looks like the stored data

  • René 327 posts 852 karma points
    Dec 19, 2012 @ 14:19
    René
    0

    Hi 

    Tanks... Sorry my fault, i had put the Umbraco pagefield related links... instesd of the macro :-)

    Some times it is difficult to see, my own errors

    René

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies