The above example looks a bit messy. But before going into further details I just need to understand this...all you want is the image path? You don't want to display the image?
Then you could just write this in the above context instead of the <img> tag: <p><xsl:value-of select="./umbracoFile" /></p>.
If you're going to use XSLT a lot then I recommend that you keep an eye on http://pimpmyxslt.com/, which is a XSLT blog done by mr. XSLT aka Chriztian Steinmeier.
Please don't hesitate to ask further questions if you're in doubt about something.
get images path in xslt
Umbraco 4.7.1.1
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:tagsLib="urn:tagsLib" xmlns:BlogLibrary="urn:BlogLibrary"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets tagsLib BlogLibrary ">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:param name="mediaFolder" select="$currentPage/getImages" />
<xsl:template match="/">
<xsl:if test="$mediaFolder!=''"> <!-- Necessary test otherwise the GetMedia(...) call throws a compiler error !! -->
<xsl:for-each select="umbraco.library:GetMedia($mediaFolder, 'False')/descendant-or-self::*[@nodeTypeAlias='Image']">
<xsl:if test="./umbracoFile">
{image : '{umbracoFile}', title : '', thumb : ''},
</xsl:if>
</xsl:for-each>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
how to insert media path in this
{image : '{umbracoFile}', title : '', thumb : ''},
{image : ' {umbracoFile} ', title : '', thumb : ''}
If I use this
<img src="{./umbracoFile}" alt="[image]" height="{umbracoHeight}" width="{umbracoWidth}" />
then is showing the image but I just need it to write the image path
Hi Brian and welcome to our :)
The above example looks a bit messy. But before going into further details I just need to understand this...all you want is the image path? You don't want to display the image?
Then you could just write this in the above context instead of the <img> tag: <p><xsl:value-of select="./umbracoFile" /></p>.
Hope this helps.
/Jan
thank you Jan it was everything I wanted
Hi Brian
Glad it helped.
If you're going to use XSLT a lot then I recommend that you keep an eye on http://pimpmyxslt.com/, which is a XSLT blog done by mr. XSLT aka Chriztian Steinmeier.
Please don't hesitate to ask further questions if you're in doubt about something.
Cheers,
Jan
is working on a reply...