SharePoint and hyperlinks – this is really curios. If you ever used the column type hyperlink in a SharePoint list, you may know what i mean. Hyperlinks are available but with limited functions:
- No filtering possible
- No option to open it in a new window
The hyperlinks automatically open the webadress in a new window if you are in detail view of an item, but not in the listview. But you can check the hyperlink at inserting – great! That means, if your customers wants to manage some web applications in a list and requires that the link opens in a new window at the listview and that he can filter and sort these web applications, you have to find a way to get it that way working. Well, you could write a custom fieldtype. But that means writing code, deployment steps and testing as well as maybe some more things to do (documentations).
But let’s think about some other standard features SharePoint offers to get it working:
Feature 1: A column from type text
- is filterable
- displays the whole hyperlink, not only the description
- does not open the hyperlink in a new window
Feature 2: A column from type multicolumn
- is not filterable
- if rich text editor is opted, can display the desciption
- is able to open the link in a new window
Feature 3: A column from type calculated
- same as Feature 1
Feature 4: A column from type Hyperlink with formatting and constraints for publishing
- is not filterable
- But it is great if you do not need a filter -> watch my other post how to use it
Seems like a nice opportunity to be creative and think about mixing the things up. What about using two columns – one for the hyperlink and one for the display? Well, if we have www.ilikesharepoint.de as webapplication then we know between www. and .de there is the application name.
One option for the hyperlink problem
The possibility shown below uses InfoPath in order to customize the list forms, therefore you need SharePoint Server Enterprise licence and you need the SharePoint Designer.
Step 1: Create a column from type hyperlink and call it “webapplicationlink”
Step 2: Create a column from type text and call it “webapplication”
Step 3: Add a formula to the webapplication field to get the name of the webapplication
The text field should not appear in the New, Edit and Display form of the list and it is filterable. In this case you need to change the listforms. You need therefore the InfoPath Designer. Open the list and the list tab and click on “Customize Form” Button.
*Remember: Therefore you need the enterprise licence
Now you can use the InfoPath formulas to retract the name of the link from itself and make the field webapplication hidden in the form. It is important, because this column you can filter in the listview, therefore this column should save some nice values.
If you need a nice overview of formulas you should look at this page.
Step 4: Change the view of the listview with SharePoint Designer
Open the view of the list and click at Options the Customize XSLT Style for the view. Search for the viewfields tag and make sure that for the column “webapplicationlink” the attribut “exclusive” is set to true. That adds the column to the view but it is not visible. Makes sense, because we don’t want to show the hyperlink column itself but get its value. The nclick in the draft view on the element of the calculated column and look at the source code. There you’ll find this part:
Replace it with this
Remember to exchange the field names with your own field names. Well, now look at your solution. What happens? If you create a new entry, you insert a hyperlink into a hyperlink field. In Display mode you see the hyperlink with description and it opens the hyperlink in a new window. So far so good.
If you go to the listview, you do not see the hyperlinkfield. You only see the calculated field and you have these options:
- column is filterable
- hyperlink opens in a new window
- hyperlink is displayed with a nice description
In this case you used some standard features of SharePoint, combine them and make a little bit customizing at listview – that’s it!
What are your experiences? How did you solve the problem? I would like to hear your solutions.
..:: I LIKE SHAREPOINT ::..