Build a url in xsl for a dynamic link in SharePoint results page

May 11th, 2011 | Posted by Marijn in sharepoint | xsl

If you create a custom results page for your SharePoint, you may want to create a custom url. For example, if you have a specific page that displays information and you want the users to go there via the search.
Or, if you want to link to the dispform for a folder instead of the contents of the folder. You could build a url in xsl with variables!


<xsl:variable name = "customv1" select="managed property 1" />
<xsl:variable name = "customv2" select="managed property 2" />
<a href="https//sharepoint/sites/list/page.aspx?customvalue1={$customv1}&amp;customvalue2={$customv2}"> Click here </a>

What this code does is create variables where you can put your mapped metadata. Those variables can be used in the link you create underneath via the {}.

You can follow any responses to this entry through the RSS 2.0 You can leave a response, or trackback.

One Response

Leave a Reply

%d bloggers like this: