| Nick's profileSharePoint DevelopmentBlogListsNetwork | Help |
|
|
April 09 Customizing SharePoint Page Title and META TagsRecently, our group deployed a public SharePoint site for a client. After deployment, the client requested the ability to control a page’s title and META tags at any given moment. For example, they wanted to change how product lines were indexed by Google, or how Google crawls the META tags of a particular page. I was immediately frightened by the idea of giving them access to SharePoint Designer and letting them rip away at each page’s source. In the end, I decided to build a custom web part that the user could simply drop on the desired page. Upon Page Load, this invisible web part queries a SharePoint List containing a mapping to other content lists within the site and obtains the user’s desired page title. The code then finds the PlaceHolderPageTitle content place holder, clears the controls from it, and adds in an EncodedLiteral with the new Page Title text. The user also has the ability to create the Keywords and Description META tags for an individual page through this web part’s Personalization properties. This tool could prove to be quite powerful with regard to content management in the SharePoint public Internet site realm. Try to view it from a site owner’s perspective. Any person in charge of a product or product line now has far greater control over how a crawler will index their pages. More importantly, it saves the people that deployed the site hours of headaches after someone accidentally rips out some relatively important source code on their home page! Below are some screenshots of the code and its results:
Page Title Before: Page Title After: Page META (Keywords/Description) before:
NONE! Page META after:
del.icio.us Tags: MOSS META,SharePoint META,MOSS Page Title,SharePoint Page Title,Share Point Page Title TrackbacksThe trackback URL for this entry is: http://customsharepoint.spaces.live.com/blog/cns!41D760DBB8E4E638!176.trak Weblogs that reference this entry
|
|
|