We are trying to add open graph meta tags to our blog, which is hosted in Sitefinity. Where is the best place to handle this?
- In the definition of the page, in "title and properties" in the section for "HTML to add to HEAD"... can I add something that will grab the title and summary?
- Is there something I can do in each of the blogs?
- Can I do something in the Template for the page? (Not my preference)
If you use an external Sitefinity template for the blog widget details view, you can add custom code behind using the Sitefinity Blogs API to get the metadata you need, and simply add it to the head in the PreRender method.
You can get the instance of the currently viewed blog post from the code behind with the following code:
I hope this is helpful!