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
    May 11, 2011 @ 09:59
    Fuji Kusaka
    0

    Link to Level 2

    Hi Guys,

     

    Am having some issues with umbraco.library:NiceUrl.


    This is how my Content Tree looks like

    - Default

    -- Page 1

    --- Sub Page 1

    --- Sub Page 2

    -- Page 2

    --- Sub Page 1

    --- Sub Page 2

    When trying to get the URL of Page 1  From any of it Sub Pages i can this error msg

    System.OverflowException: Value was either too large or too small for an Int32.

     <a>
          <xsl:attribute name="href"> <xsl:value-of select="umbraco.library:NiceUrl($currentPage/ancestor-or-self::* [@isDoc and @level = 2]/@id)"/></xsl:attribute>
         <xsl:value-of select="$currentPage/ancestor-or-self::* [@isDoc and @level = 2]/@nodeName"/>
        </a>

     

    /fuji

     

  • Rich Green 2246 posts 4006 karma points
    May 11, 2011 @ 10:06
  • Fuji Kusaka 2203 posts 4220 karma points
    May 11, 2011 @ 11:43
    Fuji Kusaka
    0

    Rich I still cant get the URL working.....my href is empty

    Is there another solution??

     

     

  • skiltz 501 posts 701 karma points
    May 11, 2011 @ 11:50
    skiltz
    0

    This works for me. You will need to "ignore errors"

     <a> 
         <xsl:attribute name="href">
          <xsl:value-of select="umbraco.library:NiceUrl($currentPage/ancestor-or-self::* [@level=2][@isDoc]/@id)"/>
         </xsl:attribute>  
         <xsl:value-of select="$currentPage/ancestor-or-self::* [@level=2][@isDoc]/@nodeName"/>
     </a>
  • praveity 100 posts 125 karma points
    May 11, 2011 @ 11:59
    praveity
    0

    try this

    <xsl:variable name="parentNodeLink" select="umbraco.library:NiceUrl($currentPage/ancestor-or-self::*[@isDoc and @level = 2]/@id)"/>
    
    <xsl:if test="$parentNodeLink != ''">
    
        <a href="$parentNodeLink">
            <xsl:value-of select="$currentPage/ancestor-or-self::* [@isDoc and @level = 2]/@nodeName"/>
        </a>
    </xsl:if>
  • Fuji Kusaka 2203 posts 4220 karma points
    May 11, 2011 @ 12:01
    Fuji Kusaka
    0

    Thanks Skiltz,

    It working now both your solution and mine that is

     

    <a>
          <xsl:attribute name="href"> <xsl:value-of select="umbraco.library:NiceUrl($currentPage/ancestor-or-self::* [@isDoc and @level = 2]/@id)"/></xsl:attribute>
         <xsl:value-of select="$currentPage/ancestor-or-self::* [@isDoc and @level = 2]/@nodeName"/>
        </a>

    I only checked the "Skip testing (ignore errors)" box.

     

    //fuji

     

     

  • 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