Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No OG for friendly sharing #137

Open
brunowoelke opened this issue Aug 17, 2020 · 1 comment
Open

No OG for friendly sharing #137

brunowoelke opened this issue Aug 17, 2020 · 1 comment

Comments

@brunowoelke
Copy link

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#>"/>
@Leesneaks
Copy link
Collaborator

Leesneaks commented May 29, 2021

@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,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants