Copied to clipboard

Flag this post as spam?

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


  • Robin Overgaard 33 posts 73 karma points
    Mar 22, 2010 @ 11:11
    Robin Overgaard
    0

    XSLT - Related links, and Items...

    Hello Guys

    I am having problems with the xslt / related links control

    I have a div section in the template where this xslt macro is to be put, but I do not want the header to show if the are is empty, but must show the header if umbraco is in canvas edit mode.

    Im trying to make this not show when either conditions are fullfilled

    1. Umbraco is not in Canvas Edit mode
    2. There are no links in the related links control.

    but it must show when

    1. Umbraco is in Canvas Edit mode
    2. No matter if there are links in the related links control

    I have supplyed my xslt code here, and I simply cant find out where it goes wrong, I suspect its the if statement that surrounds the whole block.

    <xsl:if test="count($currentPage/data [@alias = 'quick']/links/link) &gt; 0 or ($currentPage/data [@alias = 'quick'] &gt;= '' and umbraco.library:Item($currentPage/@id, 'quick', '') != '')">
    <div class="box">
      <h2>Quick Links</h2>
      <ul class="nobullet">
        <xsl:for-each select="$currentPage/data [@alias = 'quick']/links/link">
        <li>
          <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"/>
          </a>
        </li>
        </xsl:for-each>
      </ul>
     <xsl:value-of select="umbraco.library:Item($currentPage/@id, 'quick', '')" />
    </div>

    I will be greatfull for any help you could spare me

    /Robin

  • Connie DeCinko 931 posts 1160 karma points
    Mar 29, 2010 @ 19:25
    Connie DeCinko
    0

    I'm trying to solve the same problem.  Anyone?

     

  • Connie DeCinko 931 posts 1160 karma points
    Mar 29, 2010 @ 19:33
    Connie DeCinko
    0

    Robin,  it appears that you are not closing your if tag:

    </xsl:if>

     

Please Sign in or register to post replies

Write your reply to:

Draft