I'm pretty new to Umbraco, but so far I am absolutely loving it. I've managed to pick up XSLT pretty quickly and have some pretty cool stuff going on, but I'm stuck with one particular problem that I was after some help with.
I'm developing an accessories website which allows content editors to add new products to our inventory whenever they need.
I've got a doc type set up that allows them to select a main image from the media library, add a title, short and long descriptions as well as some other options in drop downs. That's all working beautifully and I have a loop set up on a front "products" page which loops through all the products and displays a small version of the image, with title and short decription for all the products which I'm happy with.
I'm getting stuck however with the alt text for the image. All the images in the media library have a textString altText which are all populated. I can't work out how to retrieve that data into my looping images.
Retrieving alt text from media images in XSLT
Hello,
I'm pretty new to Umbraco, but so far I am absolutely loving it. I've managed to pick up XSLT pretty quickly and have some pretty cool stuff going on, but I'm stuck with one particular problem that I was after some help with.
I'm developing an accessories website which allows content editors to add new products to our inventory whenever they need.
I've got a doc type set up that allows them to select a main image from the media library, add a title, short and long descriptions as well as some other options in drop downs. That's all working beautifully and I have a loop set up on a front "products" page which loops through all the products and displays a small version of the image, with title and short decription for all the products which I'm happy with.
I'm getting stuck however with the alt text for the image. All the images in the media library have a textString altText which are all populated. I can't work out how to retrieve that data into my looping images.
My XSLT currently looks like this...
I've tried to find the altText by doing something like..
but I don't know how to find the ID of the node via XSLT. (I know what the node ID is for any given image, but i need it to be dynamic).
is anyone able to help at all?
Thanks in advance.
Hi John,
You actually already have the image so you can just grab the altText property like you grab the umbracoFile property - something like this:
/Chriztian
Hi Chriztian,
Yes it worked perfectly. So simple!
Thanks for your help.
is working on a reply...