In a project I was working in I wanted to customize how the blog post was displayed. The Post.aspx in the Post list uses the new WebPartPages:XsltListViewWebPart, which is a new web part in SharePoint 2010. I would not bore you with a lot of background and stuff that You can read in the MSDN. I will just describe the solution that I implemented. I had to change the XSL Link it uses in Miscellaneous options of the web part and implement the template as follows
<!-- BaseViewID='7' and TemplateType='301' is Posts.aspx view for Blog's posts list -->
<xsl:template match="View[@BaseViewID='7' and List/@TemplateType='301']" mode="full">
<xsl:apply-templates select="." mode="AdeccoRenderView" />
</xsl:template>
<xsl:template match="View" mode="AdeccoRenderView">
<xsl:variable name="ViewStyleID">
<xsl:value-of select="ViewStyle/@ID"/>
</xsl:variable>
<!-- total first -->
<xsl:variable name="HasExtraColumn" select="$TabularView='1' and $MasterVersion=4 and ($ViewStyleID = '' or $ViewStyleID = '17')"/>
<xsl:variable name="Fields" select="ViewFields/FieldRef[not(@Explicit='TRUE')]"/>
<xsl:variable name="Groups" select="Query/GroupBy/FieldRef"/>
<xsl:variable name="Collapse" select="Query/GroupBy[@Collapse='TRUE']"/>
<xsl:variable name="GroupCount" select="count($Groups)"/>
<xsl:if test="Aggregations[not(@Value='Off')]/FieldRef">
<tr>
<xsl:if test="$HasExtraColumn">
<td/>
</xsl:if>
<xsl:if test="$InlineEdit">
<td width="1%"/>
</xsl:if >
<xsl:apply-templates mode="aggregate" select="ViewFields/FieldRef[not(@Explicit='TRUE')]">
<xsl:with-param name="Rows" select="$AllRows"/>
<xsl:with-param name="GroupLevel" select="0"/>
</xsl:apply-templates>
</tr>
</xsl:if>
<xsl:for-each select="$AllRows">
<xsl:variable name="thisNode" select="."/>
<xsl:for-each select="//Row">
<tr>
<td colspan="2">
<div class="TopTitle">
<div class="PostTitle">
<strong>
<xsl:value-of select="@Title" disable-output-escaping="yes" />
</strong>
</div>
<xsl:if test="../../@BaseViewID='7'">
<!-- Handle _edit only their own_ property on list -->
<xsl:if test="($thisNode/../@value.listpermission.EditListItems = '1' and (($thisNode/../@value.listpermission.ManageLists = '1') or ($XmlDefinition/List/@WriteSecurity = '2' and $thisNode/@Author.id = $Userid) or ($XmlDefinition/List/@WriteSecurity != '2')))">
<div class="ms-blogedit">
<a href="javascript:" onclick="javascript:STSNavigate('{$HttpVDir}/{$thisNode/../@resource.wss.lists_Folder}/{$thisNode/../@resource.wss.blogpost_Folder}/EditPost.aspx?ID={$thisNode/@ID}&Source={$HttpVDir}%2Fdefault.aspx');">
<xsl:value-of select="$thisNode/../@resource.wss.blog_edit" />
</a>
</div>
</xsl:if>
</xsl:if>
</div>
<div class="PostSubtitle" >
<div class="PostAuther" >
By: <xsl:value-of select="@Author" disable-output-escaping="yes" />
</div>
<div class="PostPublishDate">
Posted <xsl:value-of select="@PublishedDate" />
</div>
</div>
<div class="PostTable">
<div class="PostDateBox" >
<div class="PostSmallDate">
<xsl:value-of select="ddwrt:FormatDateTime(string(@PublishedDate), 1033, 'MMM. d yyyy')" />
</div>
</div>
<div class="PostBody" >
<xsl:value-of select="@Body" disable-output-escaping="yes"/>
</div>
<div class="PostComments">
<img src="_layouts/images/AdeccoPortal2010/icon_comment.png" alt="comment"/><xsl:value-of select="@NumComments" /> Comment(s)
</div>
</div>
<hr />
</td>
</tr>
</xsl:for-each>
</xsl:for-each>
<xsl:if test="$InlineEdit and not($IsDocLib) and $ListRight_AddListItems = '1'">
<xsl:call-template name="rowinsert">
<xsl:with-param name="Fields" select="$Fields"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
Now the blog post looks like the following

Not bad eh
Hope this helps you in your SharePoint 2010 implementation
|