I'm trying to update my open graph tags recently but I have an issue with the blog images, so little help will be appreciated.
Here is my code below:
{if isset($meta_description) AND $meta_description}
<meta name="description" property="og:description" content="{$meta_description|escape:'html':'UTF-8'}" />
{/if}
<meta property="og:url" content="https://{$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI}"/>
<meta property="fb:app_id" content="12345678910"/>
<meta property="og:site_name" content="{$shop_name|escape:'html':'UTF-8'}"/>
<meta property="og:title" content="{$meta_title|escape:'html':'UTF-8'}"/>
<meta property="og:type" content="{if $page_name == 'product'}product{elseif $page_name == 'blog-module'}article{else}website{/if}"/>
{if $page_name == 'product'}
<meta property="og:image" content="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'thickbox_default')|escape:'html':'UTF-8'}"/>
<meta property="og:image:width" content="664">
<meta property="og:image:height" content="500">
<meta property="og:image:alt" content="{$meta_title|escape:'html':'UTF-8'}">
{elseif $page_name == 'blog-module'}
<meta property="og:image" content="{$blog_article_img|escape:'html':'UTF-8'}"/>
<meta property="og:image:width" content="713">
<meta property="og:image:height" content="356">
<meta property="og:image:alt" content="{$meta_title|escape:'html':'UTF-8'}">
{else}
<meta property="og:image" content="https://your.site.here/img/logo.jpg"/>
<meta property="og:image:width" content="1124">
<meta property="og:image:height" content="614">
<meta property="og:image:alt" content="{$shop_name|escape:'html':'UTF-8'}">
{/if}
So my issue is with the blog module image property. It's fine if the shared link is the blog topic, but if I share my.site.com/blog the debugger tries to pickup the image I associated above.
How could I assign image for the blog page (and categories) and separate image property for the articles.
PS: This code is working on PS 1.5.6.1 so it should be working on thirtybees most probably also. The only thing to change is your images width/height, the the link of the additional logo (I had to add instead the default one) and of course you should remove the blog mentions and associated code, or change it with your blog page name.
Question
MockoB
I'm trying to update my open graph tags recently but I have an issue with the blog images, so little help will be appreciated. Here is my code below:
{if isset($meta_description) AND $meta_description} <meta name="description" property="og:description" content="{$meta_description|escape:'html':'UTF-8'}" /> {/if} <meta property="og:url" content="https://{$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI}"/> <meta property="fb:app_id" content="12345678910"/> <meta property="og:site_name" content="{$shop_name|escape:'html':'UTF-8'}"/> <meta property="og:title" content="{$meta_title|escape:'html':'UTF-8'}"/> <meta property="og:type" content="{if $page_name == 'product'}product{elseif $page_name == 'blog-module'}article{else}website{/if}"/> {if $page_name == 'product'} <meta property="og:image" content="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'thickbox_default')|escape:'html':'UTF-8'}"/> <meta property="og:image:width" content="664"> <meta property="og:image:height" content="500"> <meta property="og:image:alt" content="{$meta_title|escape:'html':'UTF-8'}"> {elseif $page_name == 'blog-module'} <meta property="og:image" content="{$blog_article_img|escape:'html':'UTF-8'}"/> <meta property="og:image:width" content="713"> <meta property="og:image:height" content="356"> <meta property="og:image:alt" content="{$meta_title|escape:'html':'UTF-8'}"> {else} <meta property="og:image" content="https://your.site.here/img/logo.jpg"/> <meta property="og:image:width" content="1124"> <meta property="og:image:height" content="614"> <meta property="og:image:alt" content="{$shop_name|escape:'html':'UTF-8'}"> {/if}
So my issue is with the blog module image property. It's fine if the shared link is the blog topic, but if I share my.site.com/blog the debugger tries to pickup the image I associated above. How could I assign image for the blog page (and categories) and separate image property for the articles.PS: This code is working on PS 1.5.6.1 so it should be working on thirtybees most probably also. The only thing to change is your images width/height, the the link of the additional logo (I had to add instead the default one) and of course you should remove the blog mentions and associated code, or change it with your blog page name.
8 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now