I'm trying to get the value of a text string of page, assign a url to it, and then display the result on a different page using xslt. I'm not sure how to get the value of the textstring.
Here is my macro:
<xsl:variable name="parent" select="umbraco.library:GetXmlNodeById(1122)" /> <!-- Input the related links property alias here --> <xsl:variable name="fieldName" select="/macro/fieldName"/> <xsl:template match="/"> <xsl:if test="$fieldName != ''"> <!-- The fun starts here --> <xsl:for-each select="$parent/* [name() = $fieldName ]/Textstring/value"> <xsl:element name="a"> <xsl:if test="./new-window[. = 'True']"> <xsl:attribute name="target">_blank</xsl:attribute> </xsl:if> <xsl:attribute name="href"> <xsl:value-of select="/myUrl.aspx"/> </xsl:attribute> <xsl:value-of select="./@title"/> </xsl:element> </xsl:for-each> </xsl:if> </xsl:template> </xsl:stylesheet>
Can you confirm if you are using a Textstring data-type for your field? (As there are parts of the XSLT that look like you might be wanting to use something different, e.g. new window & title).
If you are using the Textstring, then try this XSLT snippet:
Umbraco - Getting Textstring value
I'm trying to get the value of a text string of page, assign a url to it, and then display the result on a different page using xslt. I'm not sure how to get the value of the textstring.
Here is my macro:
Hi Seena,
Can you confirm if you are using a Textstring data-type for your field? (As there are parts of the XSLT that look like you might be wanting to use something different, e.g. new window & title).
If you are using the Textstring, then try this XSLT snippet:
Let us know how you get on.
Thanks, Lee.
Thanks. That worked!
is working on a reply...