{if $pageInfo.Controller == 'listing_details'}
    {if $pageInfo.meta_title}
        {assign var="smd_page_title" value=$pageInfo.meta_title|escape:'html'}
    {elseif $pageInfo.title}
        {assign var="smd_page_title" value=$pageInfo.title|escape:'html'}
    {elseif $pageInfo.name}
        {assign var="smd_page_title" value=$pageInfo.name|escape:'html'}
    {/if}
{else}
    {if $pageInfo.title}
        {assign var="smd_page_title" value=$pageInfo.title|escape:'html'}
    {elseif $pageInfo.name}
        {assign var="smd_page_title" value=$pageInfo.name|escape:'html'}
    {/if}
{/if}

{if $config.smd_google_name}
<!-- Google Authorship and Publisher Markup -->
<link rel="author" href="https://plus.google.com/u/0/+{$config.smd_google_name}/posts"/>
<link rel="publisher" href="https://plus.google.com/u/0/+{$config.smd_google_name}"/>
{/if}

<!-- Schema.org markup for Google+ -->
<meta itemprop="name" content="{$smd_page_title}">
{if $pageInfo.meta_description}
<meta itemprop="description" content="{$pageInfo.meta_description|strip_tags|escape:'html'}">
{/if}
{if $smd_logo}
<meta itemprop="image" content="{$smd_logo}">
{/if}

<!-- Twitter Card data -->
<meta name="twitter:card" content="{if $pageInfo.Controller == 'listing_details'}product{else}summary{/if}">
<meta name="twitter:title" content="{$smd_page_title}">
{if $pageInfo.meta_description}
<meta name="twitter:description" content="{$pageInfo.meta_description|strip_tags|escape:'html'}">
{/if}
{if $config.smd_twitter_name}
<meta name="twitter:site" content="{$config.smd_twitter_name|escape:'html'}">
{/if}
{if $smd_logo}
<meta name="twitter:image" content="{$smd_logo}">
{/if}
{if $pageInfo.Controller == 'listing_details'}
{if $smd_price}
<meta name="twitter:data1" content="{$smd_price.currency}{$smd_price.value}">
<meta name="twitter:label1" content="Price">
{/if}
{if $smd_second_field}
<meta name="twitter:data2" content="{$smd_second_field.value|escape:'html'}">
<meta name="twitter:label2" content="{$smd_second_field.key}">
{/if}
{/if}

<!-- Open Graph data -->
<meta property="og:title" content="{$smd_page_title}" />
<meta property="og:type" content="{if $pageInfo.Controller == 'listing_details'}product{else}website{/if}" />
{if $pageInfo.meta_description}
<meta property="og:description" content="{$pageInfo.meta_description|strip_tags|escape:'html'}" />
{/if}
<meta property="og:url" content="http{if $smarty.server.HTTPS == 'on'}s{/if}://{$smarty.server.HTTP_HOST}{if $smarty.server.REQUEST_URI != "/"}{$smarty.server.REQUEST_URI}{/if}" />

{if is_array($photos) && $photos|@count > 1}
{foreach from=$photos item='photo' name="listingPhotos"}
{if ($photo.Type == 'photo' || $photo.Type == 'main') && $photo.Photo}
<meta property="og:image" content="{if $tpl_settings.type != 'responsive_42'}{$smarty.const.RL_FILES_URL}{/if}{$photo.Photo}" />
{if $smarty.foreach.listingPhotos.iteration == 1 && $smd_logo_properties}
<meta property="og:image:type" content="{$smd_logo_properties.mime}" />
<meta property="og:image:width" content="{$smd_logo_properties.width}" />
<meta property="og:image:height" content="{$smd_logo_properties.height}" />
{/if}
{/if}
{/foreach}
{else}
{if $smd_logo}
<meta property="og:image" content="{$smd_logo}" />
{if $smd_logo_properties}
<meta property="og:image:type" content="{$smd_logo_properties.mime}" />
<meta property="og:image:width" content="{$smd_logo_properties.width}" />
<meta property="og:image:height" content="{$smd_logo_properties.height}" />
{/if}
{/if}
{/if}
{if $config.site_name}
<meta property="og:site_name" content="{$config.site_name|escape:'html'}" />
{/if}
{if $pageInfo.Controller == 'listing_details' && $smd_price && $curConv_rates[$smd_price.currency_code].Code}
<meta property="og:price:amount" content="{$smd_price.og_value}" />
<meta property="og:price:currency" content="{$curConv_rates[$smd_price.currency_code].Code}" />
{/if}

{if $config.smd_fb_admins}
<meta property="fb:admins" content="{$config.smd_fb_admins}" />
{/if}
{if $config.smd_fb_appid}
<meta property="fb:app_id" content="{$config.smd_fb_appid}" />
{/if}