Copied to clipboard

Flag this post as spam?

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


  • Anju 9 posts 29 karma points
    Feb 03, 2012 @ 09:32
    Anju
    0

    XSLT open in new window

    Hi,

    I would like to open link in a new window.I have attached the XSLT code below.

    I would like to open only  

    <xsl:when test="pText!=''">
            <xsl:value-of select="pText" />
     </xsl:when>

    in new window.

    Pls help me ASAP.

     

    <>
                 <xsl:attribute name ="href">
                   <xsl:choose>
                     <xsl:when test="pText!=''">
                        <xsl:value-of select="pText" />
                     </xsl:when>
                     <xsl:otherwise>
                       <xsl:value-of select="umbraco.library:NiceUrl(pLink)" />
                     </xsl:otherwise>
                   </xsl:choose>  
                 </xsl:attribute>  
                 <img src="{uploadPhoto}"  alt="{@nodeName}"/>  
              </a>   

  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 7x admin c-trib
    Feb 03, 2012 @ 09:45
    Chriztian Steinmeier
    0

    Hi Anju,

    You can do that like this:

    <a href="{umbraco.library:NiceUrl(pLink)}">
        <xsl:if test="normalize-space(pText)">
            <!-- Override the href attribute -->
            <xsl:attribute name="href">
                <xsl:value-of select="pText" />
            </xsl:attribute>
            <!-- Add a target attribute -->
            <xsl:attribute name="target">_blank</xsl:attribute>
        </xsl:if>
        <img src="{uploadPhoto}" alt="{@nodeName}" />
    </a>

    /Chriztian

  • Anju 9 posts 29 karma points
    Feb 03, 2012 @ 10:26
    Anju
    0

    Can I able to do like this? But now it is not redirecting.

     

    <xsl:when test="pText!=''">
                       <a target="_blank">
                          <xsl:attribute  name="href">
                            <xsl:value-of select="pText" />
                         </xsl:attribute>
                       </a>
                     </xsl:when>

Please Sign in or register to post replies

Write your reply to:

Draft