| Paul's profilePaul Galvin's SharePoint...BlogListsSkyDrive | Help |
|
November 07 Quick and easy: Embed a hyperlink into data view web part XSLTUPDATE (01/17/08): This blog entry talks about more hyperlink XSL goodness: http://www.sharepointsecurity.com/blog/sharepoint/sharepoint-2007-development/rewriting-links-in-search-results-xslt. Overview and Objective: I had created a simple bar chart to serve as component on a dashboard. I'll save the details on building charts for another post, but I did not invent that technique (nor the question mark, for that matter). It turned out there was a bug in the chart and while I fixed that, I took the opportunity to convert some labels into hyperlinks that pointed at the underlying list behind the graph. For example, there is a label with value "Hold". I wanted to turn the label into a hyperlink so that the user could click on it and drill down to the specific entries in the list whose status value is "Hold".
Steps:
Example: I have an URL:
I convert it into: <a href="Lists/Open%20Positions/AllItems.aspx?View=%7b84EEA2F5-121B-40B7-946F- I have manually transformed the first argument from:
to:
The second and third arguments' parameters ("FilterField1=Recruiter" and "FilterValue1=Hold" respectively) do not need to be url-encoded because they do not contain any unsafe characters. Notes: This technique should generally work anywhere you want to embed a hyperlink in XSLT where the hyperlink includes parameters on the URL such as:
I got the URL itself by accessing the custom list and manually filtering on the status column (labeled "Recruiter" above). Comments (6)
Paul Galvin
has turned off comments on this page.
TrackbacksThe trackback URL for this entry is: http://paulgalvin.spaces.live.com/blog/cns!1CC1EDB3DAA9B8AA!301.trak Weblogs that reference this entry
|
|
|