the problem is that i need "imageAlias" will be a parameter macro, how can i declare it? When i debbug my xslt the @alias value is null (don't take my parameter), althoutht $mediaPropName takes the value right of my property name which make reference to extended media Picker (damp: classic).
I saw this page (our.umbraco.org/.../getmedia), but i think that is obsolet because i'm working with 4.7 version and this page talks about Umbraco 4.5.1.
How get a Media with Umbraco 4.7
hi,
i'm working with umbraco 4.7 and i'm trying to show a image. I use the next code but don't show the image. Anybody knows why?
My xslt:
<?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"
exclude-result-prefixes="msxml umbraco.library">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:variable name="mediaPropName" select="/macro/imagen" />
<xsl:template match="/">
<xsl:variable name="media" select="umbraco.library:GetMedia($currentPage/@alias=$mediaPropName, 0) " />
<img src="{$media/umbracoFile}" alt="{$media/altText}" />
</xsl:template>
</xsl:stylesheet>
Thanks
Hi Bambu,
It should be something like this:
For more info look at: http://our.umbraco.org/wiki/reference/umbracolibrary/getmedia
Cheers,
Bas
hi Bas,
the problem is that i need "imageAlias" will be a parameter macro, how can i declare it? When i debbug my xslt the @alias value is null (don't take my parameter), althoutht $mediaPropName takes the value right of my property name which make reference to extended media Picker (damp: classic).
I saw this page (our.umbraco.org/.../getmedia), but i think that is obsolet because i'm working with 4.7 version and this page talks about Umbraco 4.5.1.
Thanks
Hi Bambu,
You could try this
//Fuji
Hi Fiji,
that doesn't work to me.
Thanks
Hi,
Finally is working with this code:
<xsl:variable name="mediaPropName" select="/macro/imagen" />
<xsl:template match="/">
<xsl:variable name="media" select="umbraco.library:GetMedia($currentPage/* [name() = $mediaPropName], 0)" />
<img src="{$media/umbracoFile}" alt="{$media/altText}" />
Regards.
Hey Bambu,
Good if you got it working, so i assume your alias name in your document type is mediaPropName? Are you using the upload field in your Document type?
Thats weird i got it working like this
//fuji
No, we are using the DAMP-Classic Datatype.
is working on a reply...