Copied to clipboard

Flag this post as spam?

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


  • eddy 43 posts 64 karma points
    Nov 26, 2010 @ 17:05
    eddy
    0

    List articles by tag on homepage

    I'm trying to pull a list of 5 articles together grouped by an umbraco document tag 'mytaghere' and present them on the homepage. I'm using Umbraco 4.5.2 with the new schema on .Net 3.5.

    Here is my xslt:

     

      <xsl:for-each select="$currentPage/descendant::TextPage [@isDoc and contains(data[@alias='tags'],'mytaghere')] ">

     

      <xsl:sort select="@createDate" order="descending" />  

     

      <xsl:if test="position() &lt;= $maxItems">

     

        <li>

          <href="{umbraco.library:NiceUrl(@id)}">
            <xsl:value-of select="@nodeName"/>
          </a>
        </li>
      </xsl:if>
    </xsl:for-each>

     

     

    At the mo the list is simply empty. Any ideas where I'm going wrong? Do I need to register the tags library in the xslt config ? 

     

    Eddy

     

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Nov 26, 2010 @ 17:08
    Matt Brailsford
    0

    Hey Eddy,

    It looks like you are using a mix of schemes, i'd probably try changing

    data[@alias='tags']

    to just

    tags

    (assuming your property alias is tags all in lowercase)

    Give that a try  and see how you get on.

    Matt

  • eddy 43 posts 64 karma points
    Nov 26, 2010 @ 17:14
    eddy
    0

    ...and I was so close! Now I can enjoy my weekend.

    Thanks Matt.

     

Please Sign in or register to post replies

Write your reply to:

Draft