none
Interactive Rating Stars for XSLTListView Blog Home Page

    Question

  • Hi All, using the OOTB blog site template, I'd like to modify the OOTB List View Web Part (using SharePoint Designer) on the home page of the blog site to also include interactive rating stars next to each entry's title. So far I've been able to get the stars to show up but I haven't been able to figure out how to make it clickable/interactive. Any ideas/suggestions? Thanks!
    http://www.henryong.com
    Friday, October 21, 2011 12:45 AM

Answers

  • Hi Henry,

    did quite a lot of research to get this working unfortunately i dont think there is any straight forward way to get this working apart from using custom view and custom xslt or any other view apart from Summary View of the POSTS list.

    During the research the conclusion is, by default the home page of Blog site uses summary view to show blog listing, even if you try to put the rating controls it will not be activated since the summary view doesn't emit Rating fields (columns). You can check the list definition of POSTS list and check views section where baseviewid=0, the view fields section doesn't have Rating Field and its set to ReadOnly=True i.e. it cannot be overridden or the summary view cannot be modified.

    so the approach would be creating custom xslt for custom view or ALL POSTS view. 

    I also found out that the previous reply of  mine which included XSL was working since by mistake i had dropped another POSTS list view webpart (By Mistake) below summary view of posts with ALL POSTS View set , because of which the necessary JavaScript required for rating got  inserted on the page and the rating was working.


    Raghavendra Shanbhag | Blog: http://moss-solutions.blogspot.com
    Please click "Propose As Answer " if a post solves your problem or "Vote As Helpful" if a post has been useful to you.
    Disclaimer: This posting is provided "AS IS" with no warranties.
    • Marked as answer by Henry Ong Friday, October 28, 2011 6:23 PM
    Friday, October 28, 2011 2:28 PM

All replies

  • I am assuming h tat your are trying to achieve rating for blog posts go through this link 

    http://otak-otak-it.blogspot.com/2011/06/add-ootb-rating-control-in-sharepoint.html

     


    http://moss-solutions.blogspot.com/
    Friday, October 21, 2011 4:32 AM
  • Hi Henry,

    Please follow the steps given below

    1. Create a custom blog.xsl file and dump the below code in the file. Upload the blog.xsl file to a style library.

    <xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" 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:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal" xmlns:o="urn:schemas-microsoft-com:office:office" ddwrt:ghost="show_all">
      <xsl:include href="/_layouts/xsl/blog.xsl"/>
      <xsl:include href="/_layouts/xsl/internal.xsl"/>
      	<xsl:param name="AllRows" select="/dsQueryResponse/Rows/Row[$EntityName = '' or (position() &gt;= $FirstRow and position() &lt;= $LastRow)]"/>
      	<xsl:param name="dvt_apos">&apos;</xsl:param>
      	<xsl:template match="/" ddwrt:ghost="hide">
        	<xsl:choose>
          		<xsl:when test="$RenderCTXOnly='True'">
            		<xsl:call-template name="CTXGeneration"/>
          </xsl:when>
          		<xsl:when test="($ManualRefresh = 'True')">
            		<xsl:call-template name="AjaxWrapper" />
          </xsl:when>
          		<xsl:otherwise>
            <xsl:apply-templates mode="RootTemplate" select="$XmlDefinition"/>
          </xsl:otherwise>
        	</xsl:choose>
      </xsl:template>
      	<xsl:template name="View_DefaultSummary_RootTemplate" mode="RootTemplate" match="View[@BaseViewID='0']" ddwrt:dvt_mode="root" ddwrt:ghost="hide">
        <xsl:apply-templates select="." mode="full" />
      </xsl:template>
      	<xsl:template match="View[@BaseViewID='0' and List/@TemplateType='301']" mode="full" ddwrt:ghost="hide">
        <xsl:apply-templates select="." mode="RenderView" />
        <xsl:apply-templates mode="footer" select="." />
      </xsl:template>
      	<xsl:template match="View" mode="RenderView" ddwrt:ghost="hide">
        	<xsl:variable name="ViewStyleID">
          <xsl:value-of select="ViewStyle/@ID"/>
        </xsl:variable>
        	<xsl:variable name="HasExtraColumn" select="$TabularView='1' and $MasterVersion=4 and ($ViewStyleID = '' or $ViewStyleID = '17')"/>
        	<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: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:for-each select="$AllRows">
          		<xsl:variable name="thisNode" select="."/>
          		<xsl:if test="$GroupCount &gt; 0">
            		<xsl:call-template name="GroupTemplate">
              			<xsl:with-param name="Groups" select="$Groups"/>
              			<xsl:with-param name="Collapse" select="$Collapse"/>
              			<xsl:with-param name="HasExtraColumn" select="$HasExtraColumn"/>
            		</xsl:call-template>
          </xsl:if>
          		<xsl:if test="not(not($NoAJAX) and not($InlineEdit) and $Collapse and $GroupCount &gt; 0)">
            <xsl:apply-templates mode="Item" select=".">
              	<xsl:with-param name="Fields" select="$Fields"/>
              	<xsl:with-param name="Collapse" select="$Collapse"/>
              	<xsl:with-param name="Position" select="position()"/>
              	<xsl:with-param name="Last" select="last()"/>
            </xsl:apply-templates>
          </xsl:if>
        </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>
      
      	<xsl:template mode="Item" match="Row[../../@TemplateType='301' and (../../@BaseViewID='0' or ../../@BaseViewID='7' or ../../@BaseViewID='8' or ../../@BaseViewID='9')]" ddwrt:ghost="" xmlns:ddwrt2="urn:frontpage:internal">
        	<xsl:param name="Fields" select="."/>
        	<xsl:param name="Collapse" select="."/>
        	<xsl:param name="Position" select="1"/>
        	<xsl:param name="Last" select="1"/>
        	<xsl:variable name="ShowBody">
          		<xsl:if test="../../@BaseViewID='0' or ../../@BaseViewID='7'">1</xsl:if>
        </xsl:variable>
        	<xsl:variable name="ShowTopDate">
          		<xsl:if test="../../@BaseViewID='0' or ../../@BaseViewID='7'">1</xsl:if>
        </xsl:variable>
        	<xsl:variable name="ShowDrafts">
          		<xsl:if test="../../@BaseViewID='7'">1</xsl:if>
        </xsl:variable>
        	<xsl:variable name="thisNode" select="."/>
        	<xsl:if test="$ShowDrafts=1 or $thisNode/@_ModerationStatus. = 0">
          <table>
            <tr class="ms-blogpostdatecol" valign="top">
              <td class= "ms-leftblogdate" style="width: 93px">
                <div id="PostDateTopBox{generate-id()}" class="ms-postcalendardateboxtop">
                </div>
                <xsl:if test="$MasterVersion = 4">
                  <div id="PostDateBottomBox{generate-id()}" class="ms-postcalendardateboxbottom" style="overflow-x:hidden">
                    <div>
                      <xsl:value-of select="$thisNode/@PublishedDate.MonthDayOnly" disable-output-escaping="yes" />
                    </div>
                  </div>
                </xsl:if>
                <xsl:if test="$MasterVersion != 4">
                  <div id="PostDateBottomBox" class="ms-postcalendardateboxbottom" style="overflow-x:hidden;font-size:0.8em">
                    <div>
                      <xsl:value-of select="$thisNode/@PublishedDate.MonthDayOnly" disable-output-escaping="yes" />
                    </div>
                  </div>
                </xsl:if>
              </td>
              <td class = "ms-rightblogpost">
                <table dir="None" cellspacing="0" cellpadding="0" width="100%" border="0">
                  <tbody>
                    <tr>
                      <td class="ms-PostTitle">
                        <a href="{$HttpVDir}/{$thisNode/../@resource.wss.lists_Folder}/{$thisNode/../@resource.wss.blogpost_Folder}/Post.aspx?ID={$thisNode/@ID}">
                          <xsl:apply-templates select="$Fields[@Name='Title']" mode="PrintField">
                            <xsl:with-param name="thisNode" select="$thisNode"/>
                            <xsl:with-param name="Position" select="$Position"/>
                          </xsl:apply-templates>
                        </a>
                      </td>
                      	<xsl:if test="../../@BaseViewID='7'">
                        	<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')))">
                          <td align="right" class="ms-blogedit">
                            <a href="javascript:" onclick="javascript:ShowPopupDialog('{$HttpVDir}/{$thisNode/../@resource.wss.lists_Folder}/{$thisNode/../@resource.wss.blogpost_Folder}/EditPost.aspx?ID={$thisNode/@ID}&amp;Source={$HttpVDir}%2Fdefault.aspx');">
                              <xsl:value-of select="'Edit'" />
                            </a>
                          </td>
                        </xsl:if>
                      </xsl:if>
                    </tr>
                  </tbody>
                </table>
                <div class="ms-PostFooter">
                  	<xsl:for-each select="$Fields">
                    	<xsl:if test="@Name!='Title' and @Type!='Note' and not(@Name='PostCategory' and $thisNode/@PostCategory='')">
                      		<xsl:choose>
                        		<xsl:when test="@Name='Author'">
                          <span class="ms-postfootercolor">
                            <xsl:value-of select="'by '"/>
                          </span>
                          			<xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
                          <xsl:value-of select="$thisNode/@Author.span" disable-output-escaping="yes" />
                        </xsl:when>
                        		<xsl:when test="@Name='PublishedDate'">
                          			<xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;&amp;nbsp;</xsl:text>
                          <span class="ms-postfootercolor">
                            <xsl:value-of select="'on'"/>
                            		<xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
                            <xsl:value-of select="$thisNode/@PublishedDate" />
                          </span>
                        </xsl:when>
                      		</xsl:choose>
                    </xsl:if>
                  </xsl:for-each>
                  <div>
                    <xsl:for-each select="$Fields">
                      	<xsl:if test="@Name='PostCategory' and not ($thisNode/@PostCategory='')">
                        <xsl:value-of select="'Category'" />
                        	<xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">:&amp;nbsp;</xsl:text>
                        <xsl:apply-templates select="$Fields[@Name='CategoryWithLink']" mode="Computed_body">
                          	<xsl:with-param name="thisNode" select="$thisNode"/>
                        </xsl:apply-templates>
                      </xsl:if>
                    </xsl:for-each>
                  </div>
                </div>
                <xsl:if test="$ShowBody=1">
                  <div class="ms-PostBody">
                    <div>
                      <xsl:apply-templates select="$Fields[@Name='Body']" mode="PrintField">
                        <xsl:with-param name="thisNode" select="$thisNode"/>
                        <xsl:with-param name="Position" select="$Position"/>
                      </xsl:apply-templates>
                    </div>
                  </div>
                </xsl:if>
                <div class="ms-PostFooter">
                  	<xsl:for-each select="$Fields">
                    	<xsl:if test="@Name ='Permalink' or @Name ='EmailPostLink' or @Name ='NumCommentsWithLink'">
                      		<xsl:choose>
                        		<xsl:when test="@Name='Permalink' or @Name='EmailPostLink' or @Name='NumCommentsWithLink'">
                          <xsl:apply-templates select="." mode="PrintFieldWithDisplayFormLink">
                            <xsl:with-param name="thisNode" select="$thisNode"/>
                            <xsl:with-param name="Position" select="$Position"/>
                          </xsl:apply-templates>
                          			<xsl:if test="@Name='Permalink' or @Name='EmailPostLink'">
                            			<xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;|&amp;nbsp;</xsl:text>
                          </xsl:if>
                        </xsl:when>
                        		<xsl:when test="$thisNode/@*[name()=current()/@Name]!=''">
                          <xsl:apply-templates select="." mode="PrintFieldWithDisplayFormLink">
                            <xsl:with-param name="thisNode" select="$thisNode"/>
                            <xsl:with-param name="Position" select="$Position"/>
                          </xsl:apply-templates>
                          			<xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;|&amp;nbsp;</xsl:text>
                        </xsl:when>
                      		</xsl:choose>
                    </xsl:if>
                  </xsl:for-each>
                </div>
                
             <!--Start Blog Post Average Rating   -->
             <div class="ms-PostFooter">
              	<xsl:for-each select="$Fields">            
                	<xsl:if test="@Name ='AverageRating'">
                		<xsl:choose>
                  			<xsl:when test="@Name='AverageRating'">
    	              			<xsl:apply-templates select="." mode="PrintFieldWithDisplayFormLink">
    	              				<xsl:with-param name="thisNode" select="$thisNode"/>
    	              				<xsl:with-param name="Position" select="$Position"/>
    	              			</xsl:apply-templates>
                  			</xsl:when>
                		</xsl:choose>
                </xsl:if>
              </xsl:for-each>
            </div>
            <!--End Blog Post Average Rating   -->
              </td>
            </tr>
          </table>
        </xsl:if>
      </xsl:template>
      
      	<xsl:template name="FieldRef_Text_body.Title" ddwrt:dvt_mode="body" match ="FieldRef[@Name='Title']" mode="Text_body" ddwrt:ghost="hide">
        	<xsl:param name="thisNode" select="."/>
        	<xsl:choose>
          		<xsl:when test="@AutoHyperLink='TRUE'">
            <xsl:value-of select="$thisNode/@*[name()=current()/@Name]" disable-output-escaping ="yes"/>
          </xsl:when>
          		<xsl:otherwise>
            <xsl:value-of select="$thisNode/@*[name()=current()/@Name]"/>
          </xsl:otherwise>
        	</xsl:choose>
      </xsl:template>
      	<xsl:template name="FieldRef_Note_body.Body" ddwrt:dvt_mode="body" match="FieldRef[@Name='Body']" mode="Note_body" ddwrt:ghost="hide">
        	<xsl:param name="thisNode" select="."/>
        <div dir="{@Direction}" class="ms-rtestate-field">
          <xsl:value-of select="$thisNode/@*[name()=current()/@Name]" disable-output-escaping="yes"/>
        </div>
      </xsl:template>
      	<xsl:template name="FieldRef_Blog_Permalink_Computed_Body.Permalink" match="FieldRef[(@ID='a194bd80-24e6-e71b-b235-3a283b9f1e71') and @Name='Permalink']" ddwrt:dvt_mode="body" mode="Computed_body" ddwrt:ghost="hide">
        	<xsl:param name="thisNode" select="."/>
        <span style="vertical-align:middle">
          <span style="height:16px;width:16px;position:relative;display:inline-block;overflow:hidden;" class="s4-clust">
            <a href="{$HttpVDir}/{$thisNode/../@resource.wss.lists_Folder}/{$thisNode/../@resource.wss.blogpost_Folder}/Post.aspx?ID={$thisNode/@ID}" style="height:16px;width:16px;display:inline-block;" >
              <img src="/_layouts/images/fgimg.png" alt="{$thisNode/../@resource.wss.posts_permlink_alt}" style="left:-0px !important;top:-412px !important;position:absolute;" title="{$thisNode/../@resource.wss.posts_permlink_alt}" class="imglink" longDesc="{$thisNode/../@resource.wss.posts_permlink_alt}" />
            </a>
          </span>
        </span>
      </xsl:template>
      	<xsl:template name="FieldRef_Blog_EmailPostLink_Computed_Body.EmailPostLink" match="FieldRef[(@ID='1c216b4a-13a6-cd5c-b37b-3776b29ff92e') and @Name='EmailPostLink']" ddwrt:dvt_mode="body" mode="Computed_body" ddwrt:ghost="hide">
        	<xsl:param name="thisNode" select="."/>
        <span style="vertical-align:middle">
          <span style="height:16px;width:16px;position:relative;display:inline-block;overflow:hidden;" class="s4-clust">
            <a href="javascript:navigateMailToLink('{$HttpVDir}%2F{$thisNode/../@resource.wss.lists_Folder}%2F{$thisNode/../@resource.wss.blogpost_Folder}%2FPost.aspx?ID%3D{$thisNode/@ID}')" style="height:16px;width:16px;display:inline-block;" >
              <img src="/_layouts/images/fgimg.png" alt="{$thisNode/../@resource.wss.posts_emailpostlink_alt}" style="left:-0px !important;top:-267px !important;position:absolute;" title="{$thisNode/../@resource.wss.posts_emailpostlink_alt}" class="imglink" longDesc ="{$thisNode/../@resource.wss.posts_emailpostlink_alt}" />
            </a>
          </span>
        </span>
      </xsl:template>
      	<xsl:template name="FieldRef_Blog_NumCommentsWithLink_Computed_Body.NumCommentsWithLink" match="FieldRef[(@ID='65746b4a-13a6-a72c-b815-3a96b29f1f9e') and @Name='NumCommentsWithLink']" ddwrt:dvt_mode="body" mode="Computed_body" ddwrt:ghost="hide">
        	<xsl:param name="thisNode" select="."/>
        <span style="vertical-align:middle">
          <span style="height:16px;width:16px;position:relative;display:inline-block;overflow:hidden;" class="s4-clust">
            <a href="{$HttpVDir}/{$thisNode/../@resource.wss.lists_Folder}/{$thisNode/../@resource.wss.blogpost_Folder}/Post.aspx?ID={$thisNode/@ID}" style="height:16px;width:16px;display:inline-block;" >
              <img src="/_layouts/images/fgimg.png" alt="{$thisNode/../@resource.wss.posts_numcommentswithlink_alt}" style="left:-0px !important;top:-396px !important;position:absolute;" title="{$thisNode/../@resource.wss.posts_numcommentswithlink_alt}" class="imglink" longDesc="{$thisNode/../@resource.wss.posts_numcommentswithlink_alt}" />
            </a>
          </span>
        </span>
        <span>
          <a href="{$HttpVDir}/{$thisNode/../@resource.wss.lists_Folder}/{$thisNode/../@resource.wss.blogpost_Folder}/Post.aspx?ID={$thisNode/@ID}">
            <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
            <xsl:value-of select="$thisNode/@NumComments" />
            <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
            <xsl:value-of select="'Comment(s)'"/>
          </a>
        </span>
      </xsl:template>
      	<xsl:template match="View[List/@TemplateType='301' and (@BaseViewID='0' or @BaseViewID='8' or @BaseViewID='9')]" mode="footer" ddwrt:ghost="hide">
        	<xsl:call-template name="pagingButtons" />
        	<xsl:if test="List/@EnableSyndication=1">
          <div class="ms-blogrss" id="BlogRSSMain{generate-id()}">
            <span style="vertical-align:middle">
              <span style="height:16px;width:16px;position:relative;display:inline-block;overflow:hidden;" class="s4-clust">
                <a href="{$HttpVDir}/_layouts/listfeed.aspx?List={$List}" style="height:16px;width:16px;display:inline-block;" >
                  <img src="/_layouts/images/fgimg.png" alt="{$Rows/@resource.wss.blog_rss_link}" style="left:-0px !important;top:-475px !important;position:absolute;" title="{$Rows/@resource.wss.blog_rss_link}" align="absmiddle" />
                </a>
              </span>
            </span>
            <a href="{$HttpVDir}/_layouts/listfeed.aspx?List={$List}">
              <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
              <xsl:value-of select="'RSS Feed'"/>
            </a>
          </div>
          <script type="text/javascript">
            var divBlogRSSNav = document.getElementById(&quot;BlogRSSNav&quot;);
            var divBlogRSSMain = document.getElementById(&quot;BlogRSSMain&quot;);
            if (divBlogRSSNav != null &amp;&amp; divBlogRSSMain != null)
            {
            divBlogRSSNav.innerHTML = divBlogRSSMain.innerHTML;
            divBlogRSSNav.className = &quot;ms-blogrssnav&quot;;
            divBlogRSSMain.removeNode(true);
            }
          </script>
        </xsl:if>
        	<xsl:if test="$EnableAlert">
          <div class="ms-blogrss" >
            <a href="{$HttpVDir}/_layouts/SubNew.aspx?List={$List}&amp;Source={$HttpVDir}%2Fdefault.aspx" longDesc="{$Rows/@resource.wss.ToolBarMenuItemAlertMe}">
              <img src="/_layouts/images/menualert.gif" alt="{$Rows/@resource.wss.ToolBarMenuItemAlertMe}" title="{$Rows/@resource.wss.ToolBarMenuItemAlertMe}" align="absmiddle" height="16px" width="16px"/>
              <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
              <xsl:value-of select="'Alert Me'"/>
            </a>
          </div>
        </xsl:if>
      </xsl:template>
      	<xsl:template name="pagingButtons" ddwrt:ghost="hide">
        	<xsl:choose>
          		<xsl:when test="$XmlDefinition/List/@TemplateType = 106 and $XmlDefinition/@RecurrenceRowset='TRUE'">
            		<xsl:if test="$dvt_nextpagedata or $dvt_prevpagedata">
              			<xsl:call-template name="CalendarExpandedRecurrenceFooter"/>
            </xsl:if>
          </xsl:when>
          		<xsl:otherwise>
            		<xsl:if test="$XmlDefinition/RowLimit[@Paged='TRUE']">
              			<xsl:call-template name="CommandFooter">
                			<xsl:with-param name="FirstRow" select="$FirstRow" />
                			<xsl:with-param name="LastRow" select="$LastRow" />
                			<xsl:with-param name="dvt_RowCount" select="$dvt_RowCount" />
              			</xsl:call-template>
            </xsl:if>
          </xsl:otherwise>
        	</xsl:choose>
      </xsl:template>
      	<xsl:template name="CommandFooter" ddwrt:ghost="hide">
        	<xsl:param name="FirstRow" select="1"/>
        	<xsl:param name="LastRow" select="1"/>
        	<xsl:param name="dvt_RowCount" select="1"/>
        	<xsl:if test="$FirstRow &gt; 1 or $dvt_nextpagedata">
          		<xsl:call-template name="Navigation">
            		<xsl:with-param name="FirstRow" select="$FirstRow" />
            		<xsl:with-param name="LastRow" select="$LastRow" />
            		<xsl:with-param name="dvt_RowCount" select="$dvt_RowCount" />
          		</xsl:call-template>
        </xsl:if>
      </xsl:template>
      	<xsl:template name="Navigation" ddwrt:ghost="hide">
        	<xsl:param name="FirstRow" select="1"/>
        	<xsl:param name="LastRow" select="1"/>
        	<xsl:param name="dvt_RowCount" select="1"/>
        	<xsl:variable name="LastRowValue">
          		<xsl:choose>
            		<xsl:when test="$EntityName = '' or $LastRow &lt; $RowTotalCount">
              <xsl:value-of select="$LastRow"/>
            </xsl:when>
            		<xsl:otherwise>
              <xsl:value-of select="$RowTotalCount"/>
            </xsl:otherwise>
          		</xsl:choose>
        </xsl:variable>
        	<xsl:variable name="NextRow">
          <xsl:value-of select="$LastRowValue + 1"/>
        </xsl:variable>
        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="ms-bottompaging">
          <tr>
            <td class="ms-bottompagingline1">
              <img src="/_layouts/images/blank.gif" width="1" height="1" alt=""/>
            </td>
          </tr>
          <tr>
            <td class="ms-bottompagingline2">
              <img src="/_layouts/images/blank.gif" width="1" height="1" alt=""/>
            </td>
          </tr>
          <tr>
            <td class="ms-vb" id="bottomPagingCell{$WPQ}">
              	<xsl:if test="not($GroupingRender)">
                	<xsl:attribute name="align">center</xsl:attribute>
              </xsl:if>
              <table>
                <tr>
                  	<xsl:if test="$dvt_firstrow &gt; 1">
                    <td>
                      <a>
                        <xsl:choose>
                          	<xsl:when test="$dvt_RowCount = 0 and not($NoAJAX)">
                            	<xsl:attribute name="onclick">
                              javascript:RefreshPageTo(event, &quot;<xsl:value-of select="$PagePath"/>?<xsl:value-of select="$ShowWebPart"/>\u0026<xsl:value-of select='$FieldSortParam'/><xsl:value-of select='$SortQueryString'/>\u0026View=<xsl:value-of select="$View"/>&quot;);javascript:return false;
                            </xsl:attribute>
                            	<xsl:attribute name="href">javascript:</xsl:attribute>
                            <img src="/_layouts/{$LCID}/images/prev.gif" border="0" alt="{$Rows/@idRewind}" />
                            <img src="/_layouts/{$LCID}/images/prev.gif" border="0" alt="{$Rows/@idRewind}" />
                          </xsl:when>
                          	<xsl:otherwise>
                            	<xsl:variable name="RealRowLimit">
                              		<xsl:choose>
                                		<xsl:when test="$XmlDefinition/Query/GroupBy[@Collapse='TRUE']/@GroupLimit">
                                  <xsl:value-of select ="$XmlDefinition/Query/GroupBy[@Collapse='TRUE']/@GroupLimit"/>
                                </xsl:when>
                                		<xsl:otherwise>
                                  <xsl:value-of select = "$XmlDefinition/RowLimit"/>
                                </xsl:otherwise>
                              		</xsl:choose>
                            </xsl:variable>
                            	<xsl:choose>
                              		<xsl:when test="not($NoAJAX)">
                                		<xsl:attribute name="onclick">
                                  javascript:RefreshPageTo(event, &quot;<xsl:value-of select="$PagePath"/>?<xsl:value-of select="$dvt_prevpagedata"/><xsl:value-of select="$ShowWebPart"/>\u0026PageFirstRow=<xsl:value-of select="$FirstRow - $RealRowLimit"/>\u0026<xsl:value-of select='$FieldSortParam'/><xsl:value-of select='$SortQueryString'/>\u0026View=<xsl:value-of select="$View"/>&quot;);javascript:return false;
                                </xsl:attribute>
                                		<xsl:attribute name="href">javascript:</xsl:attribute>
                              </xsl:when>
                              		<xsl:otherwise>
                                		<xsl:attribute name="href">
                                  javascript: <xsl:call-template name="GenFireServerEvent">
                                    			<xsl:with-param name="param" select="concat('dvt_firstrow={',$FirstRow - $XmlDefinition/RowLimit,'};dvt_startposition={',$dvt_prevpagedata,'}')"/>
                                  			</xsl:call-template>
                                </xsl:attribute>
                              </xsl:otherwise>
                            	</xsl:choose>
                            <img src="/_layouts/{$LCID}/images/prev.gif" border="0" alt="{$Rows/@idPrevious}" />
                          </xsl:otherwise>
                        </xsl:choose>
                      </a>
                    </td>
                  </xsl:if>
                  	<xsl:if test="$FirstRow &lt;= $LastRowValue">
                    <td class="ms-paging">
                      <xsl:value-of select="$FirstRow" /> - <xsl:value-of select="$LastRowValue" />
                    </td>
                  </xsl:if>
                  	<xsl:if test="$LastRowValue &lt; $dvt_RowCount or string-length($dvt_nextpagedata)!=0">
                    <td>
                      <a>
                        <xsl:choose>
                          	<xsl:when test="not($NoAJAX)">
                            	<xsl:attribute name="onclick">
                              javascript:RefreshPageTo(event, &quot;<xsl:value-of select="$PagePath"/>?<xsl:value-of select="$dvt_nextpagedata"/><xsl:value-of select="$ShowWebPart"/>\u0026PageFirstRow=<xsl:value-of select="$NextRow"/>\u0026<xsl:value-of select='$FieldSortParam'/><xsl:value-of select='$SortQueryString'/>\u0026View=<xsl:value-of select="$View"/>&quot;);javascript:return false;
                            </xsl:attribute>
                            	<xsl:attribute name="href">javascript:</xsl:attribute>
                          </xsl:when>
                          	<xsl:otherwise>
                            	<xsl:attribute name="href">
                              javascript:
                              		<xsl:call-template name="GenFireServerEvent">
                                		<xsl:with-param name="param" select="concat('dvt_firstrow={',$NextRow,'};dvt_startposition={',$dvt_nextpagedata,'}')"/>
                              		</xsl:call-template>
                            </xsl:attribute>
                          </xsl:otherwise>
                        </xsl:choose>
                        <img src="/_layouts/{$LCID}/images/next.gif" border="0" alt="{$Rows/@tb_nextpage}" />
                      </a>
                    </td>
                  </xsl:if>
                </tr>
              </table>
            </td>
          </tr>
          <tr>
            <td class="ms-bottompagingline3">
              <img src="/_layouts/images/blank.gif" width="1" height="1" alt=""/>
            </td>
          </tr>
        </table>
        	<xsl:if test="not($GroupingRender)">
          <script>
            var topPagingCell = document.getElementById(&quot;topPagingCell<xsl:value-of select='$WPQ'/>&quot;);
            var bottomPagingCell = document.getElementById(&quot;bottomPagingCell<xsl:value-of select='$WPQ'/>&quot;);
            if (topPagingCell != null &amp;&amp; bottomPagingCell != null)
            {
            topPagingCell.innerHTML = bottomPagingCell.innerHTML;
            }
          </script>
        </xsl:if>
      </xsl:template>
    </xsl:stylesheet>

     

    2. Edit the blog post xslt list view webpart on the home page of blog site and specify the custom xsl path, under Miscellaneous -> XSL Link and click ok.

    3. After the page is render it should display like the image given below

     


    http://moss-solutions.blogspot.com/
    Friday, October 21, 2011 9:32 AM
  • Hi Raghavendra, thank you so much for the walkthrough. Unfortunately the stars are still not interactive for me. They show up statically. Was there any other steps I should be looking at? Thanks!
    http://www.henryong.com
    Friday, October 21, 2011 8:47 PM
  • Hi Heny,

    I missed out to include one step, edit the default.aspx page in sharepoint designer and add the below register tag if you have not added it.

        <%@ Register
            Tagprefix="SharePoint"
            Namespace="Microsoft.SharePoint.Portal.WebControls"
            Assembly="Microsoft.SharePoint.Portal, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    
    

    I am assuming that you have enabled rating on posts lists for  a blog . if you have not enabled, navigate to Posts Lists-> List Settings ->Rating Settings-> Select yes for "All Items in the list to be rated" and click ok. Make sure you wont get any error Once you click Ok

    Make sure that User Profile services are started and for immediate results in next 1-2 minute set the following timers jobs to be run every 1 minute

    1. Social Data Maintenance Job 2. Social Rating Synchronization Job

    for further reference you can check out this blog http://www.srinisistla.com/blog/Lists/Posts/Post.aspx?ID=50

    let me know if you are still facing the issue.


    http://moss-solutions.blogspot.com/
    Saturday, October 22, 2011 2:28 AM
  • Hey Raghavendra, thank you for following up. Unfortunately, that didn't seem to help either. I also started from scratch a few times but no luck. It seems that there is javascript related to the rating stars missing from somewhere...
    http://www.henryong.com
    Monday, October 24, 2011 8:41 PM
  • ohh... i still have it up and running in my box.. Let me check if  i can provide you with some other approach.
    Raghavendra Shanbhag | Blog: http://moss-solutions.blogspot.com
    Please click "Propose As Answer " if a post solves your problem or "Vote As Helpful" if a post has been useful to you.
    Disclaimer: This posting is provided "AS IS" with no warranties.
    Tuesday, October 25, 2011 2:54 AM
  • Hi Henry,

    did quite a lot of research to get this working unfortunately i dont think there is any straight forward way to get this working apart from using custom view and custom xslt or any other view apart from Summary View of the POSTS list.

    During the research the conclusion is, by default the home page of Blog site uses summary view to show blog listing, even if you try to put the rating controls it will not be activated since the summary view doesn't emit Rating fields (columns). You can check the list definition of POSTS list and check views section where baseviewid=0, the view fields section doesn't have Rating Field and its set to ReadOnly=True i.e. it cannot be overridden or the summary view cannot be modified.

    so the approach would be creating custom xslt for custom view or ALL POSTS view. 

    I also found out that the previous reply of  mine which included XSL was working since by mistake i had dropped another POSTS list view webpart (By Mistake) below summary view of posts with ALL POSTS View set , because of which the necessary JavaScript required for rating got  inserted on the page and the rating was working.


    Raghavendra Shanbhag | Blog: http://moss-solutions.blogspot.com
    Please click "Propose As Answer " if a post solves your problem or "Vote As Helpful" if a post has been useful to you.
    Disclaimer: This posting is provided "AS IS" with no warranties.
    • Marked as answer by Henry Ong Friday, October 28, 2011 6:23 PM
    Friday, October 28, 2011 2:28 PM
  • Hi Raghavendra, thank you for the effort. I really appreciate it. That last remark gave me an idea - perhaps I can include the posts view web part and make it hidden or something. I'll try it out :)
    http://www.henryong.com
    Friday, October 28, 2011 4:39 PM
  • Hey Raghavendra, so with your help I've figured out an alternative. We can use the XSL as you have described above and then include another list view web part under the summary view of all posts as you had described. We can also make it hidden so that it doesn't show up on the page but the required javascript still registers on the page and enables the rating stars to work properly in the summary view. :)
    http://www.henryong.com
    Friday, October 28, 2011 6:25 PM
  • thats awesome.. by the way nice blog post on your website it will definitely help many people around :) 
    Raghavendra Shanbhag | Blog: http://moss-solutions.blogspot.com
    Please click "Propose As Answer " if a post solves your problem or "Vote As Helpful" if a post has been useful to you.
    Disclaimer: This posting is provided "AS IS" with no warranties.
    Wednesday, November 02, 2011 9:45 AM
  • Hi Raghavendra,

    I have tried this solution but its not working for me.

    Can you please help me out.

    Raghavendra Shanbhag
    Raghavendra Shanbhag
    Raghavendra Shanbhag
    Raghavendra Shanbhag
    Thursday, May 23, 2013 5:05 AM
  • Hi, I have the same problem. I've figure out that I must have little script on the page due to make my rating control clickable:

    <script src="/_layouts/Ratings.js?rev=14.0.7106.5002" type="text/javascript" defer></script>
    <script type="text/javascript">
            var ratingsManager = null;
            function RatingsManagerLoader()
            {
              var ratingsData = new RatingsCommonData(
                '<img src="/_layouts/images/loading16.gif"/> Загрузка...',
                'Средняя оценка',
                'Число оценок',
                'Моя оценка',
                'Спасибо. Ваша оценка получена и будет обработана в ближайшее время.',
                'Н/Д',
                'Пока без оценки',
                'Щелкните для назначения оценки (0-5)',
                'fzlezmaywwcnmrv32vceh155',
                '75051b45-7ef1-4f85-b573-3e3e146e0176',
                'http:\u002f\u002faw327:7777\u002fMyBlog',
                '0b57a73e-3d28-41af-af7b-e22eb9be53ff',
                '\u002f_layouts\u002fImages\u002fRatingsNew.png',
                '\u002f_layouts\u002fImages\u002fRatingsEmpty.png'
            );

              ratingsManager = new RatingsManager(ratingsData);

              NotifyEventAndExecuteWaitingJobs('RatingsManagerLoaded');
            }

            ExecuteOrDelayUntilScriptLoaded(RatingsManagerLoader, 'ratings.js');
          </script>
     

    Friday, April 18, 2014 3:49 PM