Copied to clipboard

Flag this post as spam?

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


  • Darryl Godden 145 posts 197 karma points
    Aug 18, 2010 @ 10:57
    Darryl Godden
    0

    Blog 4 Umbraco - Customizing Archive Post List

    Hi all,

    I'm trying to customize the Blog 4 Umbraco archive post list, which appears on the right hand side of the blog posts list. On install the archive list show other post as a UL and LI list indented.

    I'm trying to configure this as:

    Month Year

    Post Title

    Post Date

    Blog 4 Umbraco stores blog posts in a Blog document type, then year, month and day document types. I'm struggling to think how to get the XSLT to parse the folders by month, this is what I have so far:

    <xsl:for-each select="$currentPage/ancestor-or-self::node [@nodeTypeAlias = 'Blog']/node [@nodeTypeAlias = 'DateFolder']">
            <xsl:sort select="@nodeName" data-type="number" order="descending" />
            <xsl:for-each select="./node [@nodeTypeAlias = 'DateFolder']">
              <xsl:sort select="@nodeName" data-type="number" order="descending" />
              <!--<li class="month">-->
                <xsl:variable name="monthname" select="umbraco.library:FormatDateTime(concat(./../@nodeName,'-',@nodeName,'-11T10:24:46'),'MMMM yyyy')" />
                <a class="archive-date-link" href="{umbraco.library:NiceUrl(@id)}">
                    <xsl:value-of select="$monthname"/>
                </a>
            &nbsp;
            <span>
            <br />
            <div style="color:#fff;">
                <a style="color:#fff;text-decoration:none;">
                    <xsl:attribute name="href">
                        <xsl:value-of select="umbraco.library:NiceUrl($currentPage/ancestor-or-self::node/node/node/node/node/@id)" />
                    </xsl:attribute>
                    <xsl:value-of select="$currentPage/ancestor-or-self::node/node/node/node/node/@nodeName" />
                </a>
            </div>
    
            <div>
    
            </div>
    
            <div style="color:#999;">
                <xsl:value-of select="umbraco.library:FormatDateTime($currentPage/node/node/node/node/@createDate, 'dd/MM/yyy')"/>
            </div>
                  <!-- (<xsl:value-of select="count(.//node [@nodeTypeAlias = 'BlogPost'])"/>) -->
                </span>
    
            <div class="blog-separator"><!-- --></div>
    
              <!--</li>-->
            </xsl:for-each>
          </xsl:for-each>

    Any help you could give would be appreciated.

  • 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