If you create an XSLT file with a assoicated macro and inserted the macro on the template instead of include the XSLT in the template you can do it like this to get the caption out.
Thanks Dennis, it's much straightforward with Image control.
However, I need to display a custom property. I know I can create xslt, it's just a long way round what I need compared to displaying the image itself :(
works if you have created a field on your media type called "caption". Filled out the filed on the image in the media section. Added a media picker to your page with the alias of sideImage and selcted the image with the filled out property.
Macro doesn't see media custom property
I have set up a custom property for a media image, eg. caption
But then when I try to use it in a macro:
I get nothing displayed.
I tried to see what date is returned for the image using this:
and there seems not be my property value in there - only src, dimensions and ext values are returned.
I also tried with
but no change to what I get.
Anyone has idea why is that and how I can get the property value?
Thank you
Hi Eva
Try to see what will return just:
It return mediaId of course ;)
I need to get the data through GetMedia
Hi Eva
From Umbraco 4.11, there is a new control to display images very easy, just like when you output content from the umbraco:item
You use it like this:
/Dennis
Hi Eva,
If you create an XSLT file with a assoicated macro and inserted the macro on the template instead of include the XSLT in the template you can do it like this to get the caption out.
/Dennis
Thanks Dennis, it's much straightforward with Image control.
However, I need to display a custom property. I know I can create xslt, it's just a long way round what I need compared to displaying the image itself :(
Try this:
Thanks but it doesn't work either.
Sorry i pasted the wrong piece of code
works if you have created a field on your media type called "caption".
Filled out the filed on the image in the media section.
Added a media picker to your page with the alias of sideImage and selcted the image with the filled out property.
thanks but that's exactly what's not working for me.
I described it in my first post
Are you sure you've done like this:
1. Add property to image and fill it out
2. add inline xslt to your template
3. Caption renders frontend
YES, I AM SURE
And the data was in the database.
However I;ve just noticed that I have two similar images and I was just picking up the wrong one which had no caption saved.
Sorry, and thanks for leading me to that.
Cool, good you got it working :)
is working on a reply...