Initialize Page Titles from Site Map (Part 2)
Posted in Development
Bryant Likes and Kent Boogaart offered great suggestions in response to a previous post on this subject. Their suggestion was to create an HttpModule to set page titles from a site map.
Kent also suggests this approach to add meta tags, such as keywords. This offers some interesting opportunities. You can give a <siteMapNode> element arbitrary attributes and have them picked up by your HttpModule.
For example, the following node has a keywords attribute:
<siteMapNode url="page1.aspx" title="Test" description="This is a test" keywords="Keywords go here" />
The sample HttpModule, I put together per Kent’s suggestion, looks for this attribute on SiteMap.CurrentNode and adds a meta tag in the page head. You can add any other meta information or links this way. The only limit here is imagination.
Big thanks to Scott Allen for inspiring these ideas through his recent article Master Pages: Tips, Tricks, and Traps.
2 comments
Spoivamip
on October 26, 2010
Howdy I apreciated this great work in your forum,I´m also a writer just like you, web developing and Winning Money Online are my hobbies, When I´m not writing online I´m playing winning cash online!:)lol! Also yesterday I discovered a page with Forex and PTC free very well written ideal for the ones that want to start winnig it due to world economic crisis, I will leave the url here it is http://www.ptcwallet.com/index.php?ref=reidopoker ..........hope you enjoy it like I liked! stay well

Jørn Schou-Rode
on May 22, 2006
Hey - this makes sense! Usually I have a ContentPlaceHolder in the
area of my MasterPage, used for meta data and alike. Let's collect all the meta data in the sitemap instead :)