Tuesday, August 25, 2009

Changing the link on the top of a web part

Found a new SharePoint trick the other day and figured I should share.

When you insert a web part into your SharePoint site, the title of web part is formatted to be a hyperlink to the list, document library, or other SharePoint item that you used for the web part. Some web parts don't have links by default but all web parts can have it. You can also customize where that link points to.

For example, you have a confogired a filtered view of the list to use as a web part. By default, the title of the web part is linked to the default view of the underlying list, not the filtered view I used. If you want people the click the title bar to go you a different view than the default you can.
  • Select Modify Shared Web Part
  • Scroll down to the advanced section
  • Look for a field labeled Title URL.
  • It probably points to the default view such as AllItems.ASPX. If I want to point it to a different view, just copy and paste URL to the filtered view into that field and hit OK.
You can have the link point anywhere, actually. you can have your title be a hyperlink to anywher on your site or somewhere on the internet. Every web part in SharePoint has this property. So even things that don't have one by default, like the photo viewer web part or content editor web part, can have a link added.

1 comment:

ricardo said...

is there a way to read that TitleUrl property from inside the ItemStyle.xsl file? i am trying to display that link not in the webpart header but within the webpart itself. any ideas? how do you read any of the parameter values defined in a webpart?