Copied to clipboard

Flag this post as spam?

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


  • Martin 278 posts 661 karma points
    Jun 24, 2011 @ 11:19
    Martin
    0

    Embedded Content Packages + URL link

    Hi there, 

    Im still new to Umbarco & XSLT.

    Im having some trouble with having an external link with the Embedded Content package from The Farm.

    I set up the package so that the user would be able to add various business addresses on a partners page.

    This works great, but i would like the web address to be a link to the external site of that partner.

    I managed to get the email working from brwosing the forum & I have tried some work arounds such as inserting the select value of the "web" into a href tag, but with some parsing errors.

    Any help would be great.

    Thanks

    Martin

     

    The XSLT that I have is as follows. 

     

    <xsl:param name="currentPage"/>

    <xsl:template match="/">

    <!-- start writing XSLT -->
       
        
    <xsl:for-each select="$currentPage/partners/data/item">
    <div class="tal-8">
      <ul class="partnerAdd">
        <li class="location"><xsl:value-of select="location"/></li>
        <li><xsl:value-of select="address1"/></li>
        <li><xsl:value-of select="address2"/></li>
        <li><xsl:value-of select="city"/></li>
        <li><xsl:value-of select="state"/></li>
        <li><xsl:value-of select="country"/></li>
        <li><xsl:value-of select="areaCode"/></li>
        <li>T: <xsl:value-of select="telNo"/></li>
        <li>F: <xsl:value-of select="faxNo"/></li>
        <li>E: 
          <a>
            <xsl:attribute name="href">mailto:<xsl:value-of select="email"/></xsl:attribute>
            <xsl:value-of select="email"/>
          </a>
        </li>   
        <li>W: 
           <xsl:value-of select="web"/>
        </li>
             
      </ul>
    </div>      
    </xsl:for-each>

      
    </xsl:template>

  • Tom Fulton 2030 posts 4996 karma points c-trib
    Jun 24, 2011 @ 14:24
    Tom Fulton
    1

    Hi,

    You should be able to do it the same way you did your email link:

    <a target="_blank">
     <xsl:attribute name="href"><xsl:value-of select="web"/></xsl:attribute>
     <xsl:value-of select="web"/> <!-- the text to show for the link -->
    </a>

    Or a shorter way:

    <a href="{web}" target="_blank">
     <xsl:value-of select="web"/> <!-- the text to show for the link -->
    </a>

    Hope this helps,
    Tom

  • Martin 278 posts 661 karma points
    Jun 24, 2011 @ 14:41
    Martin
    0

    Thanks Tom, 

    I was trying the same solution as I had for the email and have also tried the solution you gave me.

    The probelm I had for both was that the URL seems to look locally.

    If I added a link as www.partner.com, I would get a URL of www.mysite.com/www.google.com

    The email works fine, but any help again would be great.

  • aghy 129 posts 308 karma points
    Jun 24, 2011 @ 14:43
    aghy
    0

    Hi Martin,

    Just put http:// before your web url and it will work.

    Ben

  • Martin 278 posts 661 karma points
    Jun 24, 2011 @ 14:45
    Martin
    0

    Thanks Guys, 

  • 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