An alert reader of the NewPath Consulting newsletter recently shared one of our articles on LinkedIn and noticed something interesting. When you share on social media platforms like Facebook, Twitter or LinkedIn, extra information about your post should be displayed as you begin to share an article. Unfortunately because we are using Advanced Templates on TypePad, we did not have any of the tags coded to support Open Graph, the standard coding mechanism used to render the rich media previews and search engine optimization.
The TypePad Knowledgebase has a short article on implementing Open Graph, but we went one step further and created a code snippet that can be used to create the necessary markup for both pages and posts.
Below is the code you can insert into your custom Header template or include to support a variety of meta data. These tags will cover most social media platforms. Note that we are using a tag called MTIfNonEmpty
to evaluate whether an article has an excerpt loaded. Since TypePad can autogenerate excerpts, using this tag effectively lets us evaluate whether we are adding these tags to a page or post. This conditional trickery lets us use the same piece of code on ALL of our pages and posts of the website.
">
">
- ">
">
">
- ">
- ">
" />
" />
" />
" />
- " />
" />
" />