Add meta data (keywords, description) dynamicly

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)

Add meta-data dynamically to your page by adding a HtmlMeta control to your Header. In this example I dynamically add a keyword string to the page.


string keyWords = "metatags, html, dynamic, generate";

HtmlMeta keywords = new HtmlMeta();
keywords.Name = "keywords";
keywords.Content = keyWords;
Page.Header.Controls.Add(keywords); 


You can do the same for other meta-data like description.

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
Add meta data (keywords, description) dynamicly Pieter Brinkman avatarAuthor: Pieter Brinkman ()

Pieter is Technical Marketing Manager for Sitecore Netherlands and owner of Gaatverweg.nl. He has more than ten years experience with software developing in multiple programming languages and with different Content Management Systems. Before joining Sitecore Pieter was a lead developer for multiple Sitecore and .Net projects, he joined Sitecore in 2011 as an Solution Architect in The Netherlands, after two years as an Solution Architect he joined the Technical Marketing department. In the role as Techinical Marketing Manager he is responsible for the Global MVP program and the Sitecore technical branding strategy. You can follow Pieter on twitter: @pieterbrink123 or Google+

Add meta data (keywords, description) dynamicly WebsiteAdd meta data (keywords, description) dynamicly TwitterAdd meta data (keywords, description) dynamicly Google PlusAdd meta data (keywords, description) dynamicly Linkedin

Related posts

Design Patterns(C#): Basic example Strategy pattern
WCF webservice error with DBML objects
Run website on IIS7 (Vista) in classic mode
Daily Tip: Sitecore caching sliding and absolute

One Response to Add meta data (keywords, description) dynamicly

Comments
Tweets
Pingbacks
  • Nice post! Might come in handy some times.

    Click on a tab to select how you'd like to leave your comment

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    *

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>