How to Customize Blog Posts in Sharepoint 2010
It seems like there is very little documentation online from Microsoft on customizing layouts for things like Blog Sites and Blog posts in Sharepoint 2010. I did find some posts about it online, but they were very terse and general.
This is going to be a very simple and to the point post about how to customize a Sharepoint 2010 blog post, specifically how to remove the table column with the Post date in it ( the td with ms-leftblogdate for css). This requires you to create a new XSL template file and then connect that file to the post.
- Step 1, locate the blog.xsl file on your Sharepoint server, mine was located in the following folder:
- C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\XSL
- In Sharepoint Designer create a new folder and a new file for the customized XSL file you will be creating
- I created a folder called “xsl” in the root of my Blog site and then created a file called blogPost.xsl.
- Copy the contents of the blog.xsl file into the file you just created, in my case I called it blogPost.xsl
- In Sharepoint Designer open up the Post.aspx file
- It’s in the Lists/Posts directory of your Blog Site
- Click the Advanced Mode button in the Ribbon
- Switch the Sharepoint Designer to Design Mode (the button is circled in red in the image below)
- Click on the empty cell where the Post will appear. If you can’t tell where this is, look at the image below to help you locate it. It will be a WebPartPages:XsltListVewWebpart object
- In the “Tag Properties” window of Sharepoint Designer on the right side of the screen, locate the property “XslLink” and type in the location of the new XSL file you created above
- This will be something like /blog/xsl/blogPost.xsl if you followed along above
- Return to the file you just created, blogPosts.xsl, and make your edits. I searched for the code <td class = “ms-leftblogdate”> and removed this entire TD because it was making my design look bad.
- Save both the blogPosts.xsl and the Posts.aspx files and then reload your page. You should see your changes reflected.