a good idea is to see if you get anything from the banner property.
you can do this like this
<textarea>
<xsl:copy-of select="$currentPage/banner" />
</textarea>
If this returns an id you should make a copy of your umbraco.library:GetMedia($currentPage/banner,0) to see what XML gets returned. It's probably because your match is wrong in some way, or perhaps you just need to republish the entire site?
if you want to use either true or false instead of 0 or 1 in the expression you should use false() or true() - the way you have done it it will always return true. You could write anything in there like 'test' and it would be interpreted as "true".
Using 'false" and 'true' is a comon misconception I think - I know I have been guilty of doing it myself in the past untill mr. Steinmeier wrote about how to deal with it.
problem with getMedia
Hi,
I am trying to show a banner image in my webpages.
The user can choose with Media Picker a banner image from the Media Library:
in my getbannerimage.xslt file I use the getMedia method to render my image tag:
<xsl:value-of select="umbraco.library:GetMedia($currentPage/banner, 0)/Image/umbracoFile" />
But for some reason, the image is not showing, the src attribute of the image tag is empty.
What am I doing wrong?
Thanks for your help,
Anthony Candaele
Belgium
just checking if it is possible to reply
Hi Anthony
a good idea is to see if you get anything from the banner property.
you can do this like this
<textarea>
<xsl:copy-of select="$currentPage/banner" />
</textarea>
If this returns an id you should make a copy of your umbraco.library:GetMedia($currentPage/banner,0) to see what XML gets returned. It's probably because your match is wrong in some way, or perhaps you just need to republish the entire site?
Have you had a look at the wiki entry about the usage of GetMedia? http://our.umbraco.org/wiki/reference/umbracolibrary/getmedia
Hope these pointers are helpful.
/Jan
Hi Anthony
Try this
Hi Simon
the example you provide is wrong.
if you want to use either true or false instead of 0 or 1 in the expression you should use false() or true() - the way you have done it it will always return true. You could write anything in there like 'test' and it would be interpreted as "true".
Using 'false" and 'true' is a comon misconception I think - I know I have been guilty of doing it myself in the past untill mr. Steinmeier wrote about how to deal with it.
Cheers
/Jan
Hi again
Forgort to mention that 0,1,false() and true() should be written without '' sourounding it...For an example like this:
Hi Jan,
Thanks, the problem is solved, apparently
doesn't give back the image file information, while
Does!
Thanks, now I can have lunch with some peace of mind :)
Anthony
Hi Anthony
Happy to hear you got it sorted out. It can sometime be frustrating when it's the little things that's confusing one :-)
Enjoy your lunch.
/Jan
cool Jan, thnx
is working on a reply...