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

Feature request : default fallback image #67

Open
ankedsgn opened this issue Jan 24, 2018 · 2 comments
Open

Feature request : default fallback image #67

ankedsgn opened this issue Jan 24, 2018 · 2 comments

Comments

@ankedsgn
Copy link
Contributor

ankedsgn commented Jan 24, 2018

Wishlist!
It would be lovely if there would be a default image possibility. So you can, for instance, add the logo of the company in the OG tags when no image is present in the shared page.

The og:image is one of the four required properties (title, type, url and image) sauce

default:
    title: ""
    description: ""
    ogtype: "website" 
    image: "foo.jpg"

preferably like this, in the config.

Thx!


used version: 1.0.7

@sbonardt
Copy link

sbonardt commented Apr 4, 2018

+1 👍

@sbonardt
Copy link

sbonardt commented Apr 4, 2018

@anketwokings

If you add a custom _metatags.twig to your theme folder, and add an {% else %} to the OG:image part you have yourself a workaround:

{% if image|default() is not empty %}
        <meta property="og:image" content="{{ image }}" />
{% else %}
        <meta property="og:image" content="/path/to/the/default/image.jpg" />
{% endif 
%}

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