Hi everyone... I've built an image carousel macro (uses the Nivo Slider) and I'm very happy so far with getting images to spin. My macro takes a Media folder as a parameter, so that after dropping the carousel macro on the page, users can update the carousel by just adding/removing images from the Media folder.
I've added a link property (Content Picker) to the 'Image' Media Type in Umbraco, but I can't figure out the proper syntax to get my XSLT macro to actually insert a clickable link.
If this does not create the link then try adding <textarea><xsl:copy-of selec="." /></textarea> inside the for-each statement - this will return the XML for each image, which you can expect to see the structure of the XML and the element names.
Accessing custom Media Type properties
Hi everyone... I've built an image carousel macro (uses the Nivo Slider) and I'm very happy so far with getting images to spin. My macro takes a Media folder as a parameter, so that after dropping the carousel macro on the page, users can update the carousel by just adding/removing images from the Media folder.
I've added a link property (Content Picker) to the 'Image' Media Type in Umbraco, but I can't figure out the proper syntax to get my XSLT macro to actually insert a clickable link.
Here's what I have currently...
This correctly adds/rotates images.
I was considering adding something like this within my <xsl:for-each> to output the link:
But no dice. Any help on the syntax would be great! Thanks in advance. :)
Hi Alex
What have you called your link property?
I suppose you should be able to simply just write
<a href="{link}">
<img src="{umbracoFile}" alt="@nodeName" title="{@nodeName}" />
</a>
If this does not create the link then try adding <textarea><xsl:copy-of selec="." /></textarea> inside the for-each statement - this will return the XML for each image, which you can expect to see the structure of the XML and the element names.
Hope this helps.
/Jan
Hi Alex
Maybe try
It would pay to do a check to see if a content node had been selected as a link too, otherwise you may get a XSLT error.
Cheers
Nigel
Thanks so much! Here's what I ended up putting inside my for-each loop:
is working on a reply...