Copied to clipboard

Flag this post as spam?

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


  • jigar 170 posts 233 karma points
    Jul 01, 2009 @ 13:06
    jigar
    0

    Need to generate month nodes

    Hi All,

    Here i stuck at problem of creating using months from my news archive.

    My reuirement is that i want to display  a months whose news is there in particular month and if there are more than one news pertaining to that month than also it would be visiable only once.. and if there are no news for that month than no news link should be displayed.

     

    I am using follwoing code snipet in xslt.

     

    <xsl:key name="months" match="node" use="umbraco.library:FormatDateTime(data [@alias='PublishDate'], 'MMMyyyy')"/>
      <xsl:template match="/">
          <xsl:for-each select="$currentPage/node  [string(data [@alias='HidePage']) != '1'] ">
            <xsl:if test="generate-id() = generate-id(key('months', umbraco.library:FormatDateTime(data [@alias='PublishDate'], 'MMMyyyy')))">
                <li class="item">
                       <a href="../../../regis-news/recent-media.aspx?month={umbraco.library:FormatDateTime(data [@alias='PublishDate'], 'MMMMyyyy')}">
                       <xsl:value-of select="umbraco.library:FormatDateTime(data [@alias='PublishDate'], 'MMMM yyyy')"/>
                        <br/>
                     </li>
                  </xsl:if>
      </xsl:for-each>

     

    Please help me as i am not getting any result for Jun and Jan months.

     

    Regards,

    Jigar

     

     

  • Tommy Poulsen 514 posts 708 karma points
    Jul 01, 2009 @ 21:56
    Tommy Poulsen
    0

    Hi Jigar,

    I think we need a bit of additional information. What does your input nodes (under the $currentPage) look like, what output would you be expecting and what output do you actually get? Do you get any results at all for some nodes/months?

    >Tommy

     

     

  • Jesper Ordrup 1019 posts 1528 karma points MVP
    Jul 02, 2009 @ 01:12
    Jesper Ordrup
    0

    Hi Jigar,

    Take a look at this one - http://www.jenitennison.com/xslt/grouping/index.html

    /jesper

Please Sign in or register to post replies

Write your reply to:

Draft