Haraka na rahisi: Embed hyperlink katika data maoni mtandao sehemu XSLT

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:

  1. Kutumia studio ya Visual kwa SharePoint-kufahamu Intellisense.
  2. Nakala DVWP ya XSLT katika studio ya Visual (kujenga mradi tupu, kuongeza faili XSL kwa mradi).
  3. Nakala ya kiungo unataka kutumia katika clipboard.
  4. Kuuweka katika eneo haki katika XSL.
  5. Convert URL argument separators on the query string from "&" to "&Amp;"
  6. Url-encode hoja ya mtu binafsi.
  7. 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).

6 mawazo juu ya "Haraka na rahisi: Embed hyperlink katika data maoni mtandao sehemu XSLT

  1. Paulo Galvin

    Cristina, kwamba 84EE.. ni GUID kwamba kipekee kubainisha orodha ndani. Unaweza kupata na kuunganisha hadi mtazamo katika browser yako na ukaguzi wa URL ya browser yako.

    Kujibu
  2. Cristina Perez Otaiza

    wapi au jinsi gani kuzalisha kanuni hii '84EEA2F5-121B-40B7-946F-0FA704A1DAA1′

    Inaweza kuwa inawezekana kufanya hivyo …&FilterField1 = Recruiter Center &= FilterValue1 Hold CE / ASM?

    Au
    Je, i haja ya kuondoa nafasi kati yao?

    Kujibu
  3. Eric Anderson
    Je, una mapendekezo yoyote kwa ajili ya hali ambapo unataka kupita data kutoka kwenye orodha SharePoint kama thamani FilterValue1, na ambapo thamani katika safu ichukue ampersands? (Nimejaribu njia mbalimbali encode / kutoroka thamani, lakini mimi si kuwa na mengi ya bahati katika kupita vizuri.)
    Kujibu
  4. Costas Tsaklas
    I saw the example at the Help Desk application in the ‘fab 40’. The problem I don’t know how it was generated and that’s why I’m looking forward to the steps on how to do it
    Kujibu
  5. Paulo Galvin
    Sikuweza mzulia ni, lakini ni ajabu jinsi ni vigumu kupata.
    I came across a functional example of this I think from one of the "fab 40" templates.
    It’s data view web part with XSLT that generates a graph. I definitely plan to do a post on it.
    Kujibu
  6. Costas Tsaklas
    I’m looking forward to the post about creating a chart. I have been looking for information on how to create charts based on lists (k.m. wazi, C. masuala, Asilimia nk.) and I can’t find any. Shukrani
    Kujibu

Kuondoka Reply

Anwani yako si kuchapishwa. Mashamba required ni alama *