The code you posted may have been taken out of a larger context, but in my ongoing quest for getting rid of XSLT that looks much worse than it is, here is a simpler way to do it:
<xsl:when test="$currentPage/ancestor-or-self::*[@id = 1050]">
<xsl:variable name="media" select="umbraco.library:GetMedia($gallery, 1)" />
<!-- Process the first Image -->
<xsl:apply-templates select="$media[not(error)]/Image[1]" />
</xsl:when>
...
<!-- Template for an Image -->
<xsl:template match="Image">
<a href="{umbracoFile}" rel="prettyPhoto[{../@nodeName}]" title="{test/values/value[1]}">
<span class="page-buttons gallery">
<xsl:value-of select="umbraco.library:GetDictionaryItem('Gallery')" />
</span>
</a>
</xsl:template>
Ask all you want about how it works, if you like :-)
Thanks for the input Chriztian, now i bumped into any issue where the client wasnt the possibility to change the folder name, so adding the MultipleTextString to the mediaType Folder property.
I don't quite follow, I'm afraid — did you move the Multiple Textstring property to the folder, and need to grab it from there while you're in the Image template (or context) ?
Then you need to go up to the parent - someting like:
Getting the First value of Multiple TextString
Hi everyone,
Can someone tell me how to display the first value of a multiple textString where the property alias is associated to the mediaType image.
Am using the built in multiple TextString from v4.9.1
Here is how my code looks like
Hi Fuji,
Just to clarify, is the Multiple Textstring data-type on the Content or Media node?
Thanks, Lee.
Hi Lee,
Got it working, my mistake, and yes using it in the Media Node itself.
It should be
Instead of
I had that thought, but then wasn't sure where the property was... glad that you've got it sorted! :-)
Cheers, Lee.
Hi Fuji,
The code you posted may have been taken out of a larger context, but in my ongoing quest for getting rid of XSLT that looks much worse than it is, here is a simpler way to do it:
/Chriztian
Thanks for the input Chriztian, now i bumped into any issue where the client wasnt the possibility to change the folder name, so adding the MultipleTextString to the mediaType Folder property.
Can you explain how do get the property ?
Did something like
tryied something like but not working either
Hi Fuji,
I don't quite follow, I'm afraid — did you move the Multiple Textstring property to the folder, and need to grab it from there while you're in the Image template (or context) ?
Then you need to go up to the parent - someting like:
/Chriztian
Hi Chrizitian,
Yes we move it to the Folder Media Type tried your code but without luck
is working on a reply...