Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have a basic textstring which allows people to type in an external link. The problem occurs when they don't put "http://", it breaks the link. How do I force the use of HTTP? Or, if they put HTTP:// leave it out, otherwise put it in for them.
Thanks,
<a href="{$ecmLink}" class="downloadLink" target="_blank"> <div class="projectTitle"> <xsl:value-of select="@nodeName"/> <!-- small attachment icon --> <div class="downloadIcon"><img src="/images/icons/download.png" /></div> </div></a>
Hi Devin,
Here's what I usually do - you can rewrite the attribute - don't worry, only a single href attribute will be output :-)
<a href="{$ecmLink}" class="downloadLink" target="_blank"> <!-- Rewrite the `href` attribute if it doesn't start with 'http' --> <xsl:if test="not(starts-with($ecmlink, 'http'))"> <xsl:attribute name="href"><xsl:value-of select="concat('http://', $ecmlink)" /></xsl:attribute> </xsl:if> <div class="projectTitle"> <xsl:value-of select="@nodeName"/> <!-- small attachment icon --> <div class="downloadIcon"><img src="/images/icons/download.png" /></div> </div> </a>
/Chriztian
Thanks for such a quick response! It works flawlessly of course. :)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Force the use of HTTP
I have a basic textstring which allows people to type in an external link. The problem occurs when they don't put "http://", it breaks the link. How do I force the use of HTTP? Or, if they put HTTP:// leave it out, otherwise put it in for them.
Thanks,
Hi Devin,
Here's what I usually do - you can rewrite the attribute - don't worry, only a single href attribute will be output :-)
/Chriztian
Thanks for such a quick response! It works flawlessly of course. :)
is working on a reply...