Copied to clipboard

Flag this post as spam?

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


  • Seyfullah Tıkıç 23 posts 43 karma points
    Mar 04, 2011 @ 10:14
    Seyfullah Tıkıç
    0

    List sub nodes with image

    Hello,

    I need to list sub items of current page with images near them. I have the following xslt, but it doesn't show the image named as introducerImage.

    <xsl:variable name="level" select="3"/>

    <ul>  

      <xsl:for-each select="$currentPage/ancestor-or-self::* [@level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']">   
       <li>
         <xsl:variable name="media" select="umbraco.library:GetMedia(current()/introducerPicture, 0)" />
          <xsl:if test="$media">
            <img src="{$media/umbracoFile}" alt="{$media/altText}" />
          </xsl:if>
         
        <href="{umbraco.library:NiceUrl(current()/@id)}"><xsl:value-of select="current()/@nodeName" /></a>
       </li>
      </xsl:for-each>
    </ul>

    Thanks.

  • Dirk De Grave 4537 posts 6006 karma points MVP 3x admin c-trib
    Mar 04, 2011 @ 10:30
    Dirk De Grave
    0

    seems correct, assuming your pic is taken from the media section? Also worth trying to replace the 0 value with false(). If your pic is an upload field on the doc, you'd need to reference it using

    <xsl:variable name="media" select="current()/introducerPicture" />

    Cheers,

    /Dirk

  • Seyfullah Tıkıç 23 posts 43 karma points
    Mar 04, 2011 @ 10:39
    Seyfullah Tıkıç
    0

    Thanks for comment.

    Yes, I realized that it is true.

    I deleted this topic, I think deleting topic doesn't work.

     

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies