Copied to clipboard

Flag this post as spam?

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


  • Warren 12 posts 41 karma points
    Jul 06, 2012 @ 19:33
    Warren
    0

    NiceUrl problem from Content Picker ID

    hi guys,

    a problem i have surely has a quick fix, but i cannot seem to get the right syntax, i have:

    <xsl:variable name="currentNode" select="umbraco.library:GetXmlNodeById($currentId)" />
    <xsl:variable name="currentLink" select="$currentNode/sliderPageLink" />

    <xsl:value-of select="$currentLink" disable-output-escaping="yes" />

    so far so good and the ID is displayed of the node selected by the content picker

    Then trying to get the nice url of the id is where the problem is, i have tried

    <xsl:variable name="linkData" select="umbraco.library:NiceUrl($currentLink)/data" />

    and various others but always get a parsing error on the xslt file

    any advice would be appreciated

    thanks.

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Jul 06, 2012 @ 19:59
    Chriztian Steinmeier
    0

    Hey Warren,

    If $currentLink gives you the right ID then you just need to put that into NiceUrl():

    <a href="{umbraco.library:NiceUrl($currentLink)}">Click Me!</a>

    /Chriztian

  • Warren 12 posts 41 karma points
    Jul 06, 2012 @ 20:09
    Warren
    0

    hi chriztian,

    yes i tried that also and get the parse error from the below:

    <xsl:element name="div">
      <xsl:attribute name="class">carousel-caption</xsl:attribute>
      <a href="{umbraco.library:NiceUrl($currentLink)}">
      <p><xsl:value-of select="$currentText" disable-output-escaping="yes" /></p></a>  
     </xsl:element>

    any ideas ?

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Jul 07, 2012 @ 00:13
    Chriztian Steinmeier
    0

    Hi Warren,

    There could be several reasons for that - most likely you're doing this inside a loop, and one of the nodes processed hasn't got a valid $sliderPageLink.

    Try making it conditional:

    <xsl:if test="normalize-space($currentLink)">
       <div class="carousel-caption">
          <a href="{umbraco.library:NiceUrl($currentLink)}">
             <p>...</p>
          </a>
       </div> 
    </xsl:if>

    /Chriztian

  • Warren 12 posts 41 karma points
    Jul 07, 2012 @ 00:39
    Warren
    0

    thanks chriztian, it was indeed that

Please Sign in or register to post replies

Write your reply to:

Draft