UPDATE (01/17/08): Hii blog kuingia mazungumzo juu ya wema zaidi hyperlink XSL: http://www.sharepointsecurity.com/blog/sharepoint/sharepoint-2007-development/rewriting-links-in-search-results-xslt.
Overview na Lengo: 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, lakini sikuweza mzulia kwamba mbinu (wala alama ya swali, kwa jambo hilo). 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. Kwa mfano, 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".
Hatua:
- Kutumia studio ya Visual kwa SharePoint-kufahamu Intellisense.
- Nakala DVWP ya XSLT katika studio ya Visual (kujenga mradi tupu, kuongeza faili XSL kwa mradi).
- Nakala ya kiungo unataka kutumia katika clipboard.
- Kuuweka katika eneo haki katika XSL.
- Convert URL argument separators on the query string from "&" to "&Amp;"
- Url-encode hoja ya mtu binafsi.
- Wrap kwamba ndani ya <href…> </a>
Mfano:
Nina URL:
http://[server]/[tovuti]/Orodha / Open% 20Positions/AllItems.aspx?View ={84EEA2F5-121B-40B7-946F-0FA704A1DAA1}&FilterField1 = Recruiter&= FilterValue1 Hold
Mimi kubadili kwenye:
<a href="Orodha / Open% 20Positions/AllItems.aspx?View =% 7b84EEA2F5-121B-40B7-946F-
0FA704A1DAA1}&Amp;FilterField1 = Recruiter&Amp;= FilterValue1 Hold"> Kushikilia: </a>
Mimi manually kubadilishwa hoja ya kwanza kutoka:
{84EEA2F5-121B-40B7-946F-0FA704A1DAA1}
kwa:
%7b84EEA2F5-121B-40B7-946F-0FA704A1DAA1}
(Katika hii, brace wazi kuugeuza kwa 7b% na brace kufunga kuugeuza kwa 7d%)
Hoja ya pili na ya tatu’ vigezo ("FilterField1=Recruiter" and "FilterValue1=Kushikilia" mtiririko) hawana haja ya kuwa url-encoded kwa sababu hawana vyenye wahusika yoyote salama.
Maelezo:
Mbinu hii lazima ujumla kazi mahali popote unataka kuiweka katika hyperlink XSLT ambapo hyperlink ni pamoja na vigezo juu ya URL kama vile:
http://[server]/[tovuti]/Orodha / Open% 20Positions/AllItems.aspx?View ={84EEA2F5-121B-40B7-946F-0FA704A1DAA1}&FilterField1 = Recruiter&= FilterValue1 Hold
I got URL yenyewe kwa kupata orodha ya desturi na manually kuchuja kwenye safu ya hali ya (labeled "Recruiter" juu ya).