|
|
 Rank: Enthusiast
Joined: 1/10/2008 Posts: 25 Location: Nottingham, UK
|
Hi, I need to put an IMG tag in an XSLT page, but use a dynamic URL for its source. The following kicks up an error in the XSLT editor within Umbraco: Code: <img src="<xsl:value-of select="data [@alias = 'Thumbnail']" />" />
I have looked up loads of things on Google, but can't seem to find the right syntax. I know it's getting upset about the brackets and that it needs escaping but not how to write it properly! :P thanks in advance, Nick Nottingham web design and green hosting - FCS Websites Umbraco documentation wiki - Come and join in!
|
|
Rank: Devotee
Joined: 7/19/2006 Posts: 97
|
Hi, I think you can do it like this. I havn't tested it. Code: <img> <xsl:attribute name="src"> <xsl:value-of select="data [@alias = 'Thumbnail']" /> </xsl:attribute> </img>
|
|
Rank: Newbie
Joined: 8/20/2007 Posts: 8
|
Tobbe wrote:Hi, I think you can do it like this. I havn't tested it. Code: <img> <xsl:attribute name="src"> <xsl:value-of select="data [@alias = 'Thumbnail']" /> </xsl:attribute> </img>
You should also be able to do it using an attribute value template (note the curly braces) like this: Code: <img src="{data [@alias = 'Thumbnail']}" />
Regards, Mike Sharp
|
|
 Rank: Enthusiast
Joined: 1/10/2008 Posts: 25 Location: Nottingham, UK
|
Cheers! I used the second one and it worked a treat :P Nick Nottingham web design and green hosting - FCS Websites Umbraco documentation wiki - Come and join in!
|
|
|
Guest |