Copied to clipboard

Flag this post as spam?

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


  • Sam 63 posts 126 karma points
    Apr 17, 2012 @ 12:31
    Sam
    0

    Adding an external URL property to my site nav xslt

    Hi all, I have this code

    <xsl:if test="$currentPage/ancestor-or-self::*/@id = current()/@id">
                <xsl:attribute name="class">current</xsl:attribute>
              </xsl:if>
           <xsl:attribute name="href">
             <xsl:choose>
               <xsl:when test="count(./*[@isDoc]) &gt; 1  and string(linkToSubpage) = '1'">
                   <xsl:value-of select="umbraco.library:NiceUrl(./*[@isDoc]/@id)" />
                 </xsl:when>           
                  <xsl:otherwise>
                     <xsl:value-of select="umbraco.library:NiceUrl(@id)" />
                  </xsl:otherwise>           
             </xsl:choose>

            </xsl:attribute>      
             
            <xsl:value-of select="@nodeName"/>

    i want also to add a property (textstring) with property alias "externalUrl" so that if this field is filled up...the link goes to that address.

    I must add another xslt choose I think or added some conditions in the if : if test="string(./data [@alias = 'externalUrl') != ''">.

    Dunno.

    Any help please.

     

    //Sam

     

     

     

     

  • Sam 63 posts 126 karma points
    Apr 20, 2012 @ 08:40
    Sam
    0

    Ok find it.

    Added a choose statement : <xsl:when test="externalUrl !=''">  

     

Please Sign in or register to post replies

Write your reply to:

Draft