문제

Is it possible to have "clickable" URL address in (SP 2010) calculated column without any JavaScript code or Designer?

I found the way how to easily make "universal" Document ID links visible for all documents in our portal thru Search Center, because users don't want to remake all links in documents everytime we change company structure. I created site calculated column for Document content type and users can add this column to any view but link inside is text only. No big deal, but and I want more. My code:

="https://portal/sites/search/Pages/results.aspx?k="&[Document ID Value]

Or is there any other way how to bring this URL to users? Thank you.

[edit] Solved, our developer made a feature for us (and yes, it is a kind of script attach to link in context menu after all...). Thank you

도움이 되었습니까?

해결책

We've recently released a free HTML Calculated Column; it acts just like a calculated column, but won't escape HTML:

Pentalogic's SharePoint HTML Calculated Column

To produce a clickable link, you'd use the following formula:

="<a href=\"https://portal/sites/search/Pages/results.aspx?k="&[Document ID Value]&"\">Link</a>"

Disclaimer: I work for Pentalogic; on this project actually. Oh, and I'm afraid you have to sign up for our newsletter, but that isn't a bad trade (in my unbiased opinion). :)

다른 팁

I tried this in SharePoint 2013 Online but didn't work

="<a href=\"https://portal/sites/search/Pages/results.aspx?k="&[Document ID Value]&"\">Link To Document</a>"

It doesn't like the \". As a workaround use single quotes for the URL as follows

="<a href='https://portal/sites/search/Pages/results.aspx?k="&[Document ID Value]& "'>Link To Document</a>" 

This worked although right aligned because of the number format.

Using Date instead of number makes them right aligned but they don't wrap

actually this is much easier than the options above. if you set the data type returned by the calculated column to be Number, then it is interpreted as HTML.

see this link for more details: http://sharepoint.rackspace.com/calculated-columns-tutorial

Based on what you describe, it would make more sense to reformat the search results to include the link to the documents the way you describe. By adding a calculated column to every single Document Library, you're incurring unnecessary overhead.

In SharePoint 2007 search (I just haven't looked at 2010, but I'm guessing it's the same), the search results are formatted using XSL, which you can modify to show the link (plus any other metadata) you want.

Do you want to construct a clickable url in the search center?

Then you need to modify the XSLT of the Search Core Results WebPart like Marc said. You can build the following url for instance: http:///_layouts/DocIdRedir.aspx?ID=[DocumentID]. You can reveal the document id with his managed property.

If you want a "clickable" column within a sharepoint list you have several options

  • Modify rendering template of a column. See this blogpost.
  • Create a custom workflow with sharepoint designer to build your dynamic url
  • Create a SPListItemReceiver to build your url field dynamically
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top