International issue with blogs on MySite


We found an issue with following prerequisites:

Summary: The BLOG WebPart shows always the link to personal/administrator/Blog/Lists/Posts/Post.aspx

To solve that problem for all available languages we can provide a changed BLOG.XSL which lives in the folder .....TEMPLATE\SiteTemplates\SPSMSITEHOST\blog.xsl

These files can be modified and therefore it might be not a good idea to overwrite those files by an update automatically. That is also the reason why I blog this out.

What to do?

The text below is the content of the NEW blog.xsl where the additional lines are GREEN and the changed lines are YELLOW marked. Rename the old file and add a new file with the following content.

<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes="d xsl msxsl ddwrt xmlns x __designer WebControls asp ddwrt2" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:WebControls="Microsoft.Sharepoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal">

<xsl:output method="html" indent="no"/>

<xsl:param name="dvt_apos">'</xsl:param>

<xsl:param name="filterParam"></xsl:param>

<xsl:param name="webUrl"></xsl:param>

<xsl:param name="emptyText"></xsl:param>

<xsl:param name="LocaleID">1033</xsl:param>

<xsl:variable name="dvt_1_automode">0</xsl:variable>

<xsl:template match="/">

   <xsl:call-template name="dvt_1"/>

</xsl:template>

<xsl:template name="dvt_1" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:WebControls="Microsoft.Sharepoint.WebControls">

   <xsl:param name="ParentPath" />

   <xsl:variable name="dvt_StyleName">Commas</xsl:variable>

   <xsl:variable name="Rows" select="/dsQueryResponse/NewDataSet/Row" />

   <xsl:variable name="RowCount" select="count($Rows)"/>

   <xsl:variable name="IsEmpty" select="$RowCount = 0"/>

   <xsl:choose>

      <xsl:when test="$IsEmpty">

         <xsl:call-template name="dvt_1.empty"/>

      </xsl:when>

      <xsl:otherwise>

         <xsl:call-template name="dvt_1.body">

            <xsl:with-param name="ParentPath" select="$ParentPath" />

            <xsl:with-param name="Rows" select="$Rows" />

         </xsl:call-template>

      </xsl:otherwise>

   </xsl:choose>

</xsl:template>

<xsl:template name="dvt_1.empty" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:WebControls="Microsoft.Sharepoint.WebControls">

   <xsl:value-of select="$emptyText"/>

</xsl:template>

<xsl:template name="dvt_1.body" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:WebControls="Microsoft.Sharepoint.WebControls">

   <xsl:param name="ParentPath" />

   <xsl:param name="Rows" />

   <xsl:for-each select="$Rows">

      <xsl:variable name="SrcPos">

         <xsl:number />

      </xsl:variable>

      <xsl:call-template name="dvt_1.rowview">

         <xsl:with-param name="ParentPath" select="$ParentPath" />

         <xsl:with-param name="SrcPos" select="$SrcPos" />

      </xsl:call-template>

   </xsl:for-each>

</xsl:template>

<xsl:template name="dvt_1.rowview" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:WebControls="Microsoft.Sharepoint.WebControls">

   <xsl:param name="ParentPath" />

   <xsl:param name="SrcPos" />

   <xsl:variable name="blogPath">

       <xsl:call-template name="getblogpath">

           <xsl:with-param name="encodedPath" select="@EncodedAbsUrl" />

       </xsl:call-template>

   </xsl:variable>

   <h3 class="ms-PostDate">

      <xsl:value-of select="ddwrt:FormatDateTime(string(@PublishedDate),number($LocaleID), 'MMMM dd, yyyy')" />

   </h3>

   <div class="ms-PostTitle">

      <a style="color: #295AC6;">

         <xsl:attribute name="href"><xsl:value-of select="$blogPath"/>Post.aspx?ID=<xsl:value-of select="@ID"/></xsl:attribute><xsl:value-of select="@Title" />

      </a>

   </div>

   <div class="ms-PostBody">

      <xsl:value-of select="@Body" disable-output-escaping="yes" />

   </div>

   <div class="ms-PostFooter">

      $Resources:core,blog_postfooter_postby; <xsl:value-of select="@Author" disable-output-escaping="yes" /> $Resources:core,blog_postfooter_at; <xsl:value-of select="ddwrt:FormatDate(string(@PublishedDate),number($LocaleID), 5)" />

      <xsl:if test="normalize-space(@PostCategory) != ''"> | Category: <a><xsl:attribute name="href"><xsl:value-of select="$webUrl" disable-output-escaping="yes" />$Resources:core,lists_Folder;/$Resources:core,blogcatagories_Folder;/Category.aspx?Name=<xsl:value-of select="@PostCategory"/></xsl:attribute><xsl:value-of select="@PostCategory" /></a></xsl:if> |

      <a><xsl:attribute name="href"><xsl:value-of select="$blogPath"/>Post.aspx?ID=<xsl:value-of select="@ID"/></xsl:attribute>$Resources:core,blog_postfooter_permalink;</a> |

      <a><xsl:attribute name="href"><xsl:value-of select="$blogPath"/>Post.aspx?ID=<xsl:value-of select="@ID"/>#Comments</xsl:attribute>$Resources:core,comments_schema_blg_title;(<xsl:value-of select="@NumCommentsWithLink" />)</a>

   </div>

</xsl:template>

<xsl:template name="getblogpath" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:WebControls="Microsoft.Sharepoint.WebControls">

   <xsl:param name="encodedPath"/>

   <xsl:choose>

      <xsl:when test="contains($encodedPath, '/')">              

          <xsl:value-of select="substring-before($encodedPath, '/')"/>/<xsl:call-template name="getblogpath"><xsl:with-param name="encodedPath" select="substring-after($encodedPath, '/')" /></xsl:call-template>

      </xsl:when>

     <xsl:otherwise>             

     </xsl:otherwise>

   </xsl:choose>

</xsl:template>

</xsl:stylesheet>

Comments (1)

  1. John Holliday, MVP Office SharePoint Server 2007 Paul Andrew : SharePoint at the Microsoft PDC 2008 Microsoft

Skip to main content