I am trying to create a list of all fields on subpages and it works fine for text-fields (Tiny mce). But when I try to extract the content of an upload field with an image - i get nothing. I have seen some of the postings concerning Getmedia and 4.5.2 - but I can't get it woorking.
When you're using the Upload field on the node you don't need to use the GetMedia extension - When you use <xsl:value-of select="$currentPage/picture" /> you should get the path to the image.
Thanks Jan . - i actually get the path to the image from
<xsl:value-of select="picture" disable-output-escaping="yes"/> but I canĀ“t figure out how to pass that string to an image source. I must admit that xslt in totally new stuff .....
Then you should be able to get the image displayed. Maybe the $currentPage parameter is not neccessary dependent on the context in, which you will be using this.
Getmedia U v. 4.5.2
I am trying to create a list of all fields on subpages and it works fine for text-fields (Tiny mce). But when I try to extract the content of an upload field with an image - i get nothing. I have seen some of the postings concerning Getmedia and 4.5.2 - but I can't get it woorking.
My code i quite simple.......
when I run
<a href="{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="@nodeName"/> </a>
<xsl:value-of select="kunde_TXT" disable-output-escaping="yes"/>
<br />
<xsl:value-of select="picture" disable-output-escaping="yes"/>
<br />
I get the
- the name of the subpage
- the text in "Kunde_TXT "
- the filename (including the path) of "pictue"
But when i run
<xsl:if test="$currentPage/picture !=''">
<xsl:variable name="media" select="umbraco.library:GetMedia($currentPage/picture , '0')" />
<xsl:variable name="alt" select="umbraco.library:GetMedia($currentPage/picture , 0)/@nodeName" />
<img src="{$media/umbracoFile}" alt="{$alt}"/>
</xsl:if>
i get nothing.
Any ideas- Thx / Poul
Hi Paul
When you're using the Upload field on the node you don't need to use the GetMedia extension - When you use <xsl:value-of select="$currentPage/picture" /> you should get the path to the image.
I hope this helps.
/Jan
Thanks Jan . - i actually get the path to the image from
<xsl:value-of select="picture" disable-output-escaping="yes"/> but I canĀ“t figure out how to pass that string to an image source. I must admit that xslt in totally new stuff .....
/ Poul
Try writing this in your XSLT then...
<img src="{$currentPage/picture}" alt="" />
Then you should be able to get the image displayed. Maybe the $currentPage parameter is not neccessary dependent on the context in, which you will be using this.
You could also do it like this:
<img alt="">
<xsl:attribute name="src"><xsl:value-of select="$currentPage/picture" /></xsl:attribute>
</img>
You could also create an attribute-set, but I think google got plenty of samples on how to create them :-)
/Jan
Hi Jan - thank you for your patience ............. I got
<img alt="">
<xsl:attribute name="src"><xsl:value-of select="picture" /></xsl:attribute>
</img>
to work......
/Poul
is working on a reply...