Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Heine Stick 12 posts 92 karma points
    Jun 08, 2016 @ 08:05
    Heine Stick
    0

    Multple for-each and GetMedia

    Hullo,

    So I'm having some issue with multiple xslt:for-each and GetMedia.

    This is the scenario:

    I'm trying to create an employees page. I've created multiple lists (using xslt:for-each to generate the lists).

    <ul class="nolist employeesList">
        <xsl:for-each select="$sourceNode[gruppe = 'Administration']">
            <li>
                <xsl:value-of select="@nodeName" /><br />
                <xsl:value-of select="title" /><br />
                <xsl:value-of select="$phone" />:&nbsp;<xsl:value-of select="telephone" /><br />
                <xsl:value-of select="$email" />:&nbsp;<xsl:value-of select="email" />
            </li>
        </xsl:for-each>
    </ul>
    

    So far so good (I think). The data shows as desired.

    That is, until I attempt to add an image to each li.

    This is what I've tried to insert into each for-each (within the li tags):

    <img src="{umbraco.library:GetMedia(bodyImage, 0)/umbracoFile}" /><br />
    

    This works just fine for the first for-each, but the code breaks if I insert the same into the other for-each tags as well.

    Error parsing XSLT file: \xslt\employeesList.xslt

    Does anyone out there have any suggestions as to how I can insert the property bodyImage into each for-each and have the corresponding image show on the page?

  • Heine Stick 12 posts 92 karma points
    Jun 08, 2016 @ 09:42
    Heine Stick
    0

    Never mind, fixed it. I'd failed to test for a value in the relevant property. It's been fixed now.

    Go ahead and delete/hide/close/whatever-it-is-you-forum-gurus-do. :)

Please Sign in or register to post replies

Write your reply to:

Draft