Display rating control in xslt list view webpart after migration from SP2010 to SP2013

  Make sure you have Ratings setting enabled in your list/ library.   As the rating field is not shown properly;     Add below link for XSLT; <xsl:include href=”/_layouts/15/xsl/blog.xsl”/> <xsl:include href=”/_layouts/15/xsl/internal.xsl”/> <xsl:include href=”/_layouts/15/xsl/fldtypes_Ratings.xsl”/>   Add below code for Rating; <xsl:call-template name=”emit_RatingsInitialization”/> <xsl:apply-templates select=”$Fields[@Name=’AverageRating’]” mode=”PrintField”> <xsl:with-param name=”thisNode” select=”$thisNode”/> <xsl:with-param name=”Position” select=”$Position”/> </xsl:apply-templates>

Read More

To set custom sub site icon in a custom master page.

I.e. For Sub Site – A: . For Sub Site – B: Below is the approach followed from me: Added below entry in master page but it was always resulting in wrong URL (404 URL not found) and referring to Site Collection URL (It was needed to refer sub site URL) <asp:Image runat=”server” id=”idMainSubSiteImageLink” CssClass=”subSiteIconData” ImageUrl=”../../SiteAssets/banner.png”></asp:Image> 2    I have used trick to resolve correct URL by following steps below: -Added entry of View All Site Contents from SharePoint, It’s NavigateUrl part gets converted to href with correct sub site URL. <SharePoint:SPLinkButton id=”idNavLinkViewAll1123″ CssClass=”subSiteIcon”  runat=”server” NavigateUrl=”~site/SiteAssets/banner.png” Text=””/> -Added below JavaScript to apply correct URL to Image link mentioned above and made SPLink hidden <script type=”text/javascript”>_spBodyOnLoadFunctionNames.push(“setImageSrc”);function setImageSrc() { var tempImageSrc = document.getElementById(“ctl00_idNavLinkViewAll1123”).getAttribute(“href”); document.getElementById(“ctl00_idMainSubSiteImageLink”). setAttribute(“src”,tempImageSrc); } </script> <style type=”text/css”> .subSiteIcon {display:none;} </style> – Now, it automatically applies proper image as per sub site user is navigating on.

Read More