Copied to clipboard

Flag this post as spam?

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


  • Fuji Kusaka 2203 posts 4220 karma points
    Mar 20, 2013 @ 11:46
    Fuji Kusaka
    0

    Content Picker

    Hi folks,

    I have a content picker alias in "discoverUrl" and seems like my xslt wont save and returning me errors whenever i dont choose any content.

    Here is my xslt, not sure what am doing wrong here

    <ul>
          <xsl:for-each select="$currentPage">       
            <xsl:variable name="discover" select="discoverURL" />         
            <xsl:if test="string($discover) != ' '">
                <xsl:variable name="sUrl" select="umbraco.library:NiceUrl(discoverURL)"/>
                <xsl:value-of select="$sUrl"/>
            </xsl:if>    
          </xsl:for-each>
      </ul>

    Any idea ?

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

  • Chriztian Steinmeier 2726 posts 8320 karma points MVP 4x admin c-trib
    Mar 20, 2013 @ 11:51
    Chriztian Steinmeier
    100

    Hi Fuji,

    Problem is if it's empty, it will be different from ' ' so the NiceUrl() is called.

    Use normalize-space() instead:

    <xsl:if test="normalize-space($discover)">
    ...
    </xsl:if>

    /Chriztian

  • Fuji Kusaka 2203 posts 4220 karma points
    Mar 21, 2013 @ 11:05
    Fuji Kusaka
    0

    Thanks Chriztian!

  • 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