myaac
myaac copied to clipboard
No OG for friendly sharing
Description
Allow "friendly sharing box" when tiping links on any apps.
Example to implement on index.php of templates:
<meta property="og:type" content="website"/>
<meta property="og:title" content="<?=$title_full?>"/>
<meta property="og:url" content="<#PAGE_URL#>"/>
<meta property="og:image" content="<#400x400_ICON_PATH#>"/>
<meta property="og:description" content="<#PAGE_DESCRIPTION#>"/>
@slawkens I haven't got git setup atm for commits.
but I was thinking something like this
config.php
'meta_og_logo' => 'oglogo.png',
templates.header.html.twig
<meta property="og:type" content="website"/>
<meta property="og:title" content="{{ title }}"/>
<meta property="og:url" content="{{ constant('BASE_URL') }}"/>
<meta property="og:description" content="{{ config.meta_description }}"/>
{% if og_logo %}
<meta property="og:image" content="{{og_logo}}"/>
{% endif %}
functions.php function template_header
$oglogo = isset($config['meta_og_logo']) ? $template_path .'/images/'.$config['meta_og_logo'] : null;
in the render('templates.header.html.twig
'og_logo' => ($oglogo and file_exists($oglogo)) ? $oglogo : null,