<!-- get the media XML and assign it to a variable --> <xsl:variable name="media" select="umbraco.library:GetMedia(number(data[@alias='femiletpicture']), 0)" />
<!-- check if the media XML contains an image path 'umbracoFile' --> <xsl:if test="count($media/data[@alias='umbracoFile']) > 0">
<a href="javascript:;" class="item_add">Tilføj til kurv</a>
<span class="item_thumb">
<!--- HERE IS WHERE i NEED THE PATH TO THE PICTURE PLACED -->
</span>
</div>
</xsl:if> </xsl:if>
</xsl:for-each>
im not sure what im doing wrong as i tried to place the {$media/data[@alias='umbracoFile']} but it just posts as {$media/data[@alias='umbracoFile']} - im unsure how to place this properly?.
it needs to return the path like this on the page so the javascript can use it.
Need to place media path in a span tag
hey - i have a javascript that uses a path that has been place inside a span
<span class="javacriptclass">Path placed here will be used in javascript</span>
i am trying to find out how to place a media picker there but its outside of the tag.
i know this should be obvious but i just cant see it ?
this is the code i got so far.
<xsl:for-each select="umbraco.library:GetXmlNodeById(1373)/node [string(data [@alias='umbracoNaviHide']) != '1']">
<!-- <xsl:for-each select="$currentPage/node [string(data [@alias='umbracoNaviHide']) != '1']"> -->
<xsl:if test="data[@alias='femiletpicture'] != ''">
<!-- get the media XML and assign it to a variable -->
<xsl:variable name="media" select="umbraco.library:GetMedia(number(data[@alias='femiletpicture']), 0)" />
<!-- check if the media XML contains an image path 'umbracoFile' -->
<xsl:if test="count($media/data[@alias='umbracoFile']) > 0">
<div class="simpleCart_shelfItem">
<h2 class="item_name"><xsl:value-of select="data [@alias = 'femiletname']"/></h2>
<img src="{$media/data[@alias='umbracoFile']}" alt="" title="" class="item_image" />
<span class="item_price"><xsl:value-of select="data [@alias = 'femiletprice']"/> KR,-</span>
<a href="javascript:;" class="item_add">Tilføj til kurv</a>
<span class="item_thumb">
<!--- HERE IS WHERE i NEED THE PATH TO THE PICTURE PLACED -->
</span>
</div>
</xsl:if>
</xsl:if>
</xsl:for-each>
im not sure what im doing wrong as i tried to place the {$media/data[@alias='umbracoFile']}
but it just posts as {$media/data[@alias='umbracoFile']} - im unsure how to place this properly?.
it needs to return the path like this on the page so the javascript can use it.
you can just use
in the span tag
Hope this helps.
Regards,
/Dirk
Ok thank you - weird i tried that earlier O.o - must have forgotten to reload the page properly or something. Thanx dirk
is working on a reply...