Copied to clipboard

Flag this post as spam?

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


  • Michael 8 posts 28 karma points
    Sep 15, 2011 @ 12:30
    Michael
    0

    Get contents of featured item block

    Hi,

    I have some featured items with customizable image, title and content. How can i put this all together in a macro?

    Below my code so far:

    <div class="featured-item">
      <xsl:if test="$currentPage/ccZwemABCImage !=''">
        <img src="{umbraco.library:GetMedia($currentPage/ccZwemABCImage, 0)/umbracoFile}" />
      </xsl:if>
    </div>
  • Fuji Kusaka 2203 posts 4220 karma points
    Sep 15, 2011 @ 12:41
    Fuji Kusaka
    0

    Hi Michael,

    You could do something like

    <divclass="featured-item">
    <h1>
    <xsl:value-of select="title" disable-output-escaping="yes"/> <h1>/>
    <xsl:value-of select="content" disable-output-escaping="yes"/> <br/>
      <xsl:iftest="$currentPage/ccZwemABCImage !=''">
        <imgsrc="{umbraco.library:GetMedia($currentPage/ccZwemABCImage, 0)/umbracoFile}"/>
      </xsl:if>
    </div>
  • Michael 8 posts 28 karma points
    Sep 15, 2011 @ 13:42
    Michael
    0

    Hi Fuji,

    I had already tried your code before but that unfortunately leaves blank.

    Maybe this info helps:

    1. I have a document type called 'Home' with different tabs for the featured items. Each tab has the following generic properties: image, title and content.
    2. So the featured items will display on the homepage. Maybe i need a for-each loop?

    Thank you for your time.

     
    Type text or a website address or translate a document.

    Dutch to English translation

  • Michael 8 posts 28 karma points
    Sep 15, 2011 @ 16:16
    Michael
    0

    I got it!

    <xsl:value-of select="$currentPage/title"/>
  • 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