Copied to clipboard

Flag this post as spam?

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


  • Tom Maton 387 posts 660 karma points
    Oct 07, 2009 @ 10:33
    Tom Maton
    0

    'or' statement within for-each GetMedia

    Hi All,

    I am just ondering how I go about doing hte following on a for-each for a getMedia()

    I know in XSL I can do the following

    <xsl:if test="self::pubdate or self::dc:date">
    <xsl:element name="pubdate">
    <xsl:value-of select="." />
    </xsl:element>
    </xsl:if>

    But if I wanted to do this for two aliases on a GetMedia item I cant get it working. I have this so far

    <xsl:for-each select="umbraco.library:GetMedia($mediaID,'true')/node [string(data [@alias = 'resourceBehaviour']) = $filterItem] or [string(data [@alias = 'resourceTopic']) = $filterItem]">
          ...         
    </xsl:for-each>

    Sorry for all the newbie questions, still relatively new to XSL

    Thanks

    Tom

  • Ron Brouwer 273 posts 768 karma points
    Oct 07, 2009 @ 10:36
    Ron Brouwer
    0

    try this

    <xsl:for-each select="umbraco.library:GetMedia($mediaID,'true')/node [string(data [@alias = 'resourceBehaviour']) = $filterItem or string(data [@alias = 'resourceTopic']) = $filterItem]">
          ...          
    </xsl:for-each>

    Ron

     

     

  • Tom Maton 387 posts 660 karma points
    Oct 07, 2009 @ 11:48
    Tom Maton
    0

    Hi Ron,

    That worked a treat, wasn't far off.

    Tom

Please Sign in or register to post replies

Write your reply to:

Draft