- Sep 22, 2007
- 33,655
- 688
- 126
Hello!
I'm having issues formatting some XSL code and I was hoping someone could help. I'm customizing the People Search Results on Sharepoint and I want to replace the default results link (which references a GUID linked to the user's profile) with a link that uses the account name instead. Here is the code snippet I'm trying to use to do that:
<xsl:variable name="accountname" select="accountname"/>
<xsl:variable name="url">http://serverurl/person.aspx?accountname={$accountname}</xsl:variable>
However, when I look at the returned link on the search results page, it is literally the following link (the account name is not being substituted in the brackets):
http://serverurl/person.aspx?accountname={$accountname}
I also tried replacing the second line with the following but the web part errors out completely when I do it:
<xsl:variable name="url" select="{concat('http://serverurl/person.aspx?accountname=',$accountname)}" />
I know this has to be something simple that I am overlooking and what is surprising is that this seems to be a fairly common request but I haven't found a completely working XSL code snippet. Any ideas? accountname is definitely returned in the query's XML results, so I know the value is there.
Thanks
I'm having issues formatting some XSL code and I was hoping someone could help. I'm customizing the People Search Results on Sharepoint and I want to replace the default results link (which references a GUID linked to the user's profile) with a link that uses the account name instead. Here is the code snippet I'm trying to use to do that:
<xsl:variable name="accountname" select="accountname"/>
<xsl:variable name="url">http://serverurl/person.aspx?accountname={$accountname}</xsl:variable>
However, when I look at the returned link on the search results page, it is literally the following link (the account name is not being substituted in the brackets):
http://serverurl/person.aspx?accountname={$accountname}
I also tried replacing the second line with the following but the web part errors out completely when I do it:
<xsl:variable name="url" select="{concat('http://serverurl/person.aspx?accountname=',$accountname)}" />
I know this has to be something simple that I am overlooking and what is surprising is that this seems to be a fairly common request but I haven't found a completely working XSL code snippet. Any ideas? accountname is definitely returned in the query's XML results, so I know the value is there.
Thanks
Last edited: