About      |       Articles      |      Services      |      Software      |      Contact

Latest Free SharePoint Software

ARB Security Solutions regularly releases free SharePoint software, including WebParts, Client Applications, Framework Extensions, and other Miscellaneous Components.
The most recent freeware is:

Title: Simple SharePoint Rollup WebPart
Date Published: 10/22/2009

Previous Two Free WebPart Releases:

SecureCenter For SharePoint

By SharePoint security integrators, for SharePoint security integrators.

SharePoint Security Assurance Program™

For externally facing SharePoint deployments, security is an acutely important deployment concern. Learn how through daily security scanning, you can ensure external business users and partners that they can collaborate in confidence!

Security Assurance WebPart:



Rewriting Links In Search Results (XSLT)

Occasionly you may find that you want to build your own link translation functions directly into the search XSLT, essentially stating two parameters, the URL attributes to find, and the URL attributes to replace it to, adjusting the return on the SharePoint search results page.

This is not difficult to do, and can simply be done in your XML available in the WebPart properties in your Search Results WebPart. In the below, you can see that the two previously talked about variables are the same URL, however the prefix to is simply being adjusted to the SSL enabled site. Not a very clever example, however accurately solves the problem.

XML:
  1. <xsl:variable name="rewrite_from" select="'http://sharepointsecurity.com'" />
  2. <xsl:variable name="rewrite_to" select="'https://sharepointsecurity.com'" />
  3. <xsl:variable name="rewritten_url">
  4. <xsl:choose>
  5. <xsl:when test="starts-with(sitename, $rewrite_from)">
  6. <xsl:value-of select="$rewrite_to" /><xsl:value-of select="substring-after(sitename,$rewrite_from)" />
  7. </xsl:when>
  8. <xsl :o therwise>
  9. <xsl:value-of select="sitename" />
  10. </xsl :o therwise>
  11. </xsl:choose>
  12. </xsl:variable>

Once you have this in your XSLT, you can use the rewritten_url variable to do whatever you want!

  • Share/Bookmark

3 Comments »

  1. Hi there,
    I have been trying to do this but cannot get my sitename property to be picked up.

    IF I use

    it just spits out url. (incidentally, i tested just printing sitename and it works.)

    If i declare a variable called mysite I cant get it to pick up the value of sitename.

    I tried

    0

    but mysite remains empty. \

    any ideas?

    Comment by Steve — September 19, 2008 @ 7:53 am

  2. oops, seems like my code gets stripped out. would you mind sending me an email so that I could mail you my code?

    Comment by Steve — September 19, 2008 @ 7:54 am

  3. Maybe I should word my question differently. I cant seem to get my variable populated with the sitename property.

    If I enter a string for the variable select then it all works. But when I say select=”sitename” the variable is empty.

    any ideas?

    Comment by Steve — September 19, 2008 @ 8:54 am

RSS feed for comments on this post. TrackBack URL

Leave a comment