I'd like to gain controll over what is shared on social media, by implementing open graph tags.
I figured, there are two ways of doing it.
My first approach was editing entries.tpl like that:
Code: Select all
{if $view eq "entry" && isset($is_single_entry)}
<meta property="og:title" content="{$entry.properties.meta_head_title|escape}" />
<meta property="og:type" content="article" />
<meta property="og:url" content="{$entry.rdf_ident}" />
<meta property="og:description" content="{$entry.properties.meta_description}" />
<meta property="og:image" content="{?}" />
{else}
<meta property="og:title" content="{$blogTitle}" />
<meta property="og:type" content="blog" />
<meta property="og:url" content="{$serendipityBaseURL}" />
<meta property="og:description" content="{$blogDescription}" />
<meta property="og:image" content="url-of-my-standard-blog-picture" />
{/if}
<meta property="og:site_name" content="{$blogTitle}" />
Secondly I'm aware of the existence of the facebook plugin and tested it. Even though it implements the desired picture, it seems less useful than the first approach. Mainly because the plugin pulls text from the entry body. Not sure if and how one could merge the entry meta_description into the facebook plugin output.
Also it costs performance to read the API for comments, which I'm not particularly interested in. Finally I would still have to edit entries.tpl to set meaningful sharing options for pages, that are no single articles.
I wonder what will turn out as the solution of choice. With your help, hopefully.