For better performance (because GetMedia() is comparatively slow (especially if you use anything other than 0 or false() as the second parameter) I would encourage you to save the Afbeelding item in a variable and then reference it for all its properties.
Alt tag in XSLT
I want to use the image Name as Alt tag. Does someone know if that is possible?
Hi bas
Yes that is possible. I think that you could actually just do it just by writing alt="{@nodeName}".
Hope this helps.
/Jan
Hi Jan,
It helped a bit :-).
Is shoud be alt="{umbraco.library:GetMedia($currentPage/data [@alias = 'Afbeelding'], false)/@nodeName}"
Thanx!
Bas
For better performance (because GetMedia() is comparatively slow (especially if you use anything other than 0 or false() as the second parameter) I would encourage you to save the Afbeelding item in a variable and then reference it for all its properties.
Something like:
You could also pick up the image width and heigh with the umbracoWidth and umbracoHeight properties. And all with one GetMedia() call.
Every little bit helps!
cheers,
doug.
Hi Doug,
Thanx for the reply, very userfull!
cheers,
Bas
Be sure to mark the solution if it works for you. That will help the next person with a similar question.
cheers,
doug.
+1 one for Doug's code snippet - I was in a bit of a hurry when I answered - but Doug's solution is indeed better.
/Jan
is working on a reply...