Copied to clipboard

Flag this post as spam?

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


  • Kyle Skrinak 272 posts 327 karma points
    Jun 11, 2011 @ 19:32
    Kyle Skrinak
    0

    Blog & 4.7: Archives only lists January for month

    Oddities? Here is the view from "inside" umbraco:

    And here's the view, rendered in the out-facing page:

    Why do I only see January for the month? How do I fix this?

    This is using the "StartKit Blog, version 1.1"

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Jun 12, 2011 @ 14:44
    Jan Skovgaard
    1

    Hi Kyle

    What version of the blog package did you install?

    And do you have any idea what the XSLT file rendering the dates look like? Then please post the code :)

    /Jan

  • Kyle Skrinak 272 posts 327 karma points
    Jun 12, 2011 @ 16:12
    Kyle Skrinak
    0

    Starter Blog v 1.1 + umbraco 4.7

    The Archive page calls this: 

    <div umb_macroalias="BlogFullArchive" ismacro="true" onresizestart="return false;" umbversionid="a6562ec2-7de7-4b3f-9aea-d0862c5c0d87" umbpageid="1263" title="This is rendered content from macro" class="umbMacroHolder">

    which, in turn, calls this XSLT. Do I misread? Does this XSLT hard-code the year?

    version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:msxml="urn:schemas-microsoft-com:xslt"
      xmlns:msxsl="urn:schemas-microsoft-com:xslt"
      xmlns:math="http://exslt.org/math"
      xmlns:umbraco.library="urn:umbraco.library"
      exclude-result-prefixes="msxml umbraco.library">


      <xsl:output method="html" omit-xml-declaration="yes"/>

      <xsl:param name="currentPage"/>

      <xsl:template match="/">
        <div id="archieve">

          <xsl:for-each select="$currentPage/ancestor-or-self::umbBlog/DateFolder">
      <xsl:sort select="number(@nodeName)" data-type="number" order="descending"/>
      <h3>
        <xsl:value-of select="@nodeName"/>
      h3>
      <div class="tab">
        <xsl:for-each select="./DateFolder">
          <xsl:sort select="number(@nodeName)" data-type="number" order="descending"/>
          <h4>
            <xsl:value-of select="umbraco.library:FormatDateTime( concat('01-', @nodeName , '-2010'), 'MMMM' )"/>
          h4>
          <ul>
            <xsl:for-each select=".//umbBlogPost">
        <li>
          <href="{umbraco.library:NiceUrl(@id)}">
            <xsl:value-of select="@nodeName"/>
          a>
          <br/>
          <small>
            Posted: <xsl:value-of select="umbraco.library:LongDate(PostDate)"/>
            By: <xsl:value-of select="@writerName"/>
          small>
        li>

            xsl:for-each>
          ul>
        xsl:for-each>
      div>

          xsl:for-each>
        div>

      xsl:template>

    xsl:stylesheet>

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Jun 12, 2011 @ 18:54
    Jan Skovgaard
    1

    Hi Kyle

    I'm guessing that this package is using some kind of named datefolders perhaps?

    I think this block is doing it...

    In this code...

        <li>
          <href="{umbraco.library:NiceUrl(@id)}">
            <xsl:value-of select="@nodeName"/>
          </a>
          <br/>
          <small>
            Posted: <xsl:value-of select="umbraco.library:LongDate(PostDate)"/>
            By: <xsl:value-of select="@writerName"/>
          </small>
        </li>

    You write out the nodeName, which I suppose is "January" for some obscure reason? :-)

    Hope this helps.

    /Jan

  • Kyle Skrinak 272 posts 327 karma points
    Jun 13, 2011 @ 02:31
    Kyle Skrinak
    0

    Here is the troublesome line:

    <h4>
            <xsl:value-of select="umbraco.library:FormatDateTime( concat('01-', @nodeName , '-2010'), 'MMMM' )"/>
    <h4>

    Look at the screen shots. The months are correct in the editor/rendered view, but not on the actual page. Odd, no?

  • Kyle Skrinak 272 posts 327 karma points
    Jun 20, 2011 @ 12:44
    Kyle Skrinak
    0

    Argh; any other ideas?

  • Jonathan Roberts 409 posts 1063 karma points
    Feb 22, 2012 @ 13:58
    Jonathan Roberts
    0

    January is coming from the 01 part of the string - test this by changing it to 02 so you need to alter the string

    Change this:

    <h4>
    <xsl:value-of select="umbraco.library:FormatDateTime( concat('01-', @nodeName , '-2010'), 'MMMM' )"/>
    <h4>

     

    To:

    <h4>
    <xsl:value-of select="umbraco.library:FormatDateTime( concat(@nodeName, '-', '01', '-2010'), 'MMMM' )"/>
    <h4>

     

     

  • Anthony van Leeuwen 1 post 21 karma points
    Oct 30, 2012 @ 22:54
    Anthony van Leeuwen
    0

    The correct xslt line of code in "umbBlogFullArchive.xslt" is as follows:

    <h4>
    <xsl:value-of select="umbraco.library:FormatDateTime( concat(@nodeName,'-01' ,'-2010'), 'MMMM' )"/>

    </h4

    The above change shows the correct month on the archive page on the website, but the January month shows up in the content archive page in edit mode.  Not sure of what is going on.

Please Sign in or register to post replies

Write your reply to:

Draft