How to Display SharePoint Blog Post Archives


HTML clipboard

In this article I am showing how to make a share point blog post archive using share point calculated column and Data view. It will be helpful with default SharePoint blog template.

It has two steps

I. Create a calculated column

II. Create a data view web part

1. Just create a calculated column named "Month" as shown below

2. It Should be a calculated column data type is of Single Line Text

Image1.gif

3. Formula will be like this =TEXT([Published],"mmm yy")

4. Once you done this the month and year of posting will be added at the post document library

Image2.gif

5. You have done with the part one. Now we have to move to part II.

6. For this you have to create a data view web part for Post

7. You have to refer my previous blog on Data view for making data view web part for the Post

8. You have to add the columns Title and Created

    http://www.c-sharpcorner.com/UploadFile/Roji.Joy/2795/Default.aspx?ArticleID=65f5c00b-fe01-44e2-8eb7-f28ed60bfdaa

9. Please follow the link up to the step 6

10. Click on the menu marked red you will get the pop up as shown below

Image3.gif

11. You have to select Month field from the next pop up

Image4.gif

12. Click OK

13. In Designer code view search for the part dvt_groupfield

14. And you will see this section,

15.
<xsl:when test="not ($dvt_groupfield)">
       
<xsl:value-of select="ddwrt:NameChanged(string(@PublishedDate), 0)" />
</xsl:when>

 
16. Change this as shown below

17.
<xsl:when test="not ($dvt_groupfield)"><xsl:value-of select="ddwrt:NameChanged(string(substring(@Month,3)), 0)" />
    </xsl:when>


18. Just scroll down from where you changed group value in XSL a bit, and you should see this line

19. Change ddwrt:GenDisplayName(string(@Month)) as shown below

Image5.gif

20. <xsl:when test="not (@Month) and (@Month) != false()"><xsl:value-of select="' '" /></xsl:when>
<xsl:otherwise><xsl:value-of select="string(substring(@Month,1))" /></xsl:otherwise>


21. You are done now you got the Blog post as Achieve as shown below

Image6.gif

22. If you want to link Title to the respective blog post you have to see my previous Article

     http://www.c-sharpcorner.com/UploadFile/Roji.Joy/3117/Default.aspx?ArticleID=9b4efbce-00c3-47ef-8205-0a04744872ae

Image7.gif