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
Umbraco ver: 4.7.2
Hi im trying to get this result:
/media/7009/1-Booking-Hotel-aarhus.jpg
/media/7009/1-Booking-Hotel-aarhus.jpg128085390980jpg
any ideas hov to remove the number after the image path, og how it gets there
Here is my xslt
<?xml version="1.0" encoding="utf-8" ?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:umb="urn:umbraco.library" exclude-result-prefixes="umb" > <xsl:output method="xml" indent="yes" omit-xml-declaration="yes" /> <xsl:param name="currentPage" /> <!--<xsl:variable name="mediaFolder" select="$currentPage/mediaFolder" />--> <xsl:variable name="mediaFolder" select="/macro/mediaFolder" /> <xsl:template match="/"> <xsl:if test="$mediaFolder[Folder]"> <xsl:variable name="media" select="umb:GetMedia($mediaFolder/Folder/@id, true())" /> <!-- If no errors, this will run the Folder template below --> <xsl:apply-templates select="$media[not(error)]" /> </xsl:if> </xsl:template> <!-- Template for the folder --> <xsl:template match="Folder"> <!-- Run templates for individual items (just add Media type aliases) --> <xsl:apply-templates select="File | Image" /> </xsl:template> <!-- Template for items - you can create individual templates to render them differently --> <xsl:template match="File | Image"> { src: '<xsl:apply-templates/>', fade: 4000}, <!--<a href="{umbracoFile}"><img src="{umbracoFile}" /></a>--> </xsl:template> </xsl:stylesheet>
Tanks in advance.. René
Hi Rene
Can you try to change this
<xsl:variable name="media" select="umb:GetMedia($mediaFolder/Folder/@id, true())" />
to
<xsl:variable name="media" select="umb:GetMedia($mediaFolder/Folder/@id, true())/umbracoFile" />
Hi René,
You're getting those numbers becuse the <xsl:apply-templates/> instruction you inserted will run through all the properties (umbracoFile, umbracoWidth etc.) - you just need to take the value of umbracoFile, like this:
<xsl:template match="File | Image"> <xsl:text />{ src: '<xsl:value-of select="umbracoFile" />', fade: 4000}<xsl:text /> <xsl:if test="not(position() = last())">, </xsl:if> </xsl:template>
/Chriztian
Hi
Tanks for the quick response..
When i do this i get "The XSLT didn't generate any output"
Kindly René
HI
Tanks a lot, you just saved my day... .
This worked
<xsl:templatematch="File | Image"> <xsl:text/>{ src: '<xsl:value-ofselect="umbracoFile"/>', fade: 4000}<xsl:text/> <xsl:iftest="not(position() = last())">, </xsl:if></xsl:template>
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Xslt Get media path
Umbraco ver: 4.7.2
Hi im trying to get this result:
/media/7009/1-Booking-Hotel-aarhus.jpg
/media/7009/1-Booking-Hotel-aarhus.jpg128085390980jpg
any ideas hov to remove the number after the image path, og how it gets there
Here is my xslt
Tanks in advance.. René
Hi Rene
Can you try to change this
to
Hi René,
You're getting those numbers becuse the <xsl:apply-templates/> instruction you inserted will run through all the properties (umbracoFile, umbracoWidth etc.) - you just need to take the value of umbracoFile, like this:
/Chriztian
Hi
Tanks for the quick response..
When i do this i get "The XSLT didn't generate any output"
Kindly René
HI
Tanks a lot, you just saved my day... .
This worked
is working on a reply...