How do I reference a media image in a list. Options
lloydphillips
Posted: Thursday, May 29, 2008 5:38:15 AM
Rank: Devotee

Joined: 5/22/2008
Posts: 61
Location: Auckland, New Zealand
I've got a list that links to a bunch of sibling pages. I've done two loops for preceding and following siblings along with the current page in the middle so that all the pages are always available. Each page has 2 properties set to them for this section. A SubText property which is just a TextString and an Icon which I had as a media file (png Image). I can't get the png icon to show and I'm not sure if I am doing it correctly. This is my code:

Code:

<xsl:element name="img">
        <xsl:attribute name="src">
            <xsl:value-of select="umbraco.library:GetMedia(data[@alias='Icon'], 'false')"/>
        </xsl:attribute>
</xsl:element>


If I skip the test I'm still getting a compile error. I think I'm using GetMedia correctly but I'm obviously doing something wrong.

Lloyd
pth
Posted: Friday, June 13, 2008 4:07:15 PM

Rank: Newbie

Joined: 12/14/2007
Posts: 17
Location: Denmark, Silkeborg
Hi Lloyd.

I had the same problem. and I solved it with this:
<xsl:value-of select="umbraco.library:GetMedia(./data [@alias =
'Icon'], 'false')/data [@alias = 'umbracoFile']"/>

Think your missing the last part after 'false'
hope it helped.
Pth
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.