|
Key
This line was removed.
This word was removed. This word was added.
This line was added.
|
Changes (29)
View page history... |
| 1. Naigate to your search page and in the edit mode of your page select Edit Webpart on the Search Core Results WP |
| [|http://www.sharemuch.com/wp-content/uploads/2010/03/search-core-reults-webpart.JPG] |
| |
| !http://www.sharemuch.com/wp-content/uploads/2010/03/search-core-reults-webpart.JPG|border=1! |
| 2. Now in the DisplayProperties \-> Fetched Properties add the following item to the list of fetched columns: |
| *_<Column Name=”Rating”/>_* |
| <Column Name=”Rating”/> |
| 3. Cick XSL Editor button right below the Fetched Properties field. You will see quite a bit of XML in the following window so paste it to Notepad and find the following line of code: |
| *_<xsl:call-template name=”DisplayAuthors”>_* |
| <xsl:call-template name=”DisplayAuthors”> |
| and paste the following code right above it. This will make sure the rating control appears right before the author information in the search results: {code} |
| |
| <xsl:choose> |
| <xsl:when test=”rating > 0″> <span> <xsl:attribute name=”title”> <xsl:value-of select=”rating”/> </xsl:attribute> <xsl:call-template name=”stars”> <xsl:with-param name=”starCount” select=”rating”/> </xsl:call-template> <xsl:if test=”round(rating) > rating”> <img src=”/_Layouts/Images/Ratings/RatingsNew.png”/> </xsl:if> </span> <br/> </xsl:when> <xsl:otherwise> <b>Not Rated</b> <br/> </xsl:otherwise> </xsl:choose> |
| <xsl:when test=”rating > 0″> <span> <xsl:attribute name=”title”> <xsl:value-of select=”rating”/> </xsl:attribute> <xsl:call-template name=”stars”> <xsl:with-param name=”starCount” select=”rating”/> </xsl:call-template> <xsl:if test=”round(rating) > rating”> <img src=”/_Layouts/Images/Ratings/RatingsNew.png”/> </xsl:if> </span> <br/> </xsl:when> <xsl:otherwise> <b>Not Rated</b> <br/> </xsl:otherwise> </xsl:choose> |
| <xsl:choose> |
| <xsl:when test=”rating > 0″> <span> <xsl:attribute name=”title”> <xsl:value-of select=”rating”/> </xsl:attribute> <xsl:call-template name=”stars”> <xsl:with-param name=”starCount” select=”rating”/> </xsl:call-template> <xsl:if test=”round(rating) > rating”> <img src=”/_Layouts/Images/Ratings/RatingsNew.png”/> </xsl:if> </span> <br/> </xsl:when> <xsl:otherwise> <b>Not Rated</b> <br/> </xsl:otherwise> </xsl:choose> |
| {code} |
... |
| {code} |
| |
| <xsl:template name=”stars”> |
| <xsl:param name=”starCount”/> |
| <xsl:param name=”starCount”/> |
| |
| <xsl:param name=”value” select=”1″/> |
| <xsl:param name=”value” select=”1″/> |
| |
| <xsl:if test=”$value <= $starCount”> |
| |
| <img src=”/_Layouts/Images/Ratings/RatingsNew.png”/> |
| <img src=”/_Layouts/Images/Ratings/RatingsNew.png”/> |
| |
| <xsl:call-template name=”stars”> |
| <xsl:call-template name=”stars”> |
| |
| <xsl:with-param name=”starCount” select=”$starCount”/> |
| <xsl:with-param name=”starCount” select=”$starCount”/> |
| |
| <xsl:with-param <xsl:with-param name=”value” select=”$value + 1″/> |
| |
| </xsl:call-template> |
| </xsl:call-template> |
| |
| </xsl:if> |
| </xsl:if> |
| |
| </xsl:template> |
| {code} |
| 5. Lastly, we need to provision te *{_}Rating _{*}search preoperty (column we’re going to grab a data from). In your central admin Service Applications (*{_}http://\[central admin (*_[http://\[central]_* *{_}admin URL\]/_admin/ServiceApplications.aspx{_}*) highligh *{_}Search Service Administration{_}* and click Manage on the ribbon. |
| 6. Pefrom a full search crawl which you can initiate from *{_}Content Sources{_}* left nav link. Wait for the crawl to complete. |
... |
