We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Is it possible to have fallback images, similar to how we can define fallbacks for titles & descriptions using the seo.custom object?
e.g. {% set seo = craft.seo.custom(entry.seo.title, entry.seo.description ?: entry.introduction, true) %}
{% set seo = craft.seo.custom(entry.seo.title, entry.seo.description ?: entry.introduction, true) %}
Also, setting seo to the seo.custom object as above stops pulling through any social data.
The text was updated successfully, but these errors were encountered:
4c763af
Thanks!
Dropping my code in here for anyone else who wants to use this in the same way.
{% set seo = entry.seo %} {% set social = craft.seo.social(seo) %} {% set fb = social.facebook -%} {% set tw = social.twitter -%} {% set seo = craft.seo.custom( entry.seo.title, entry.seo.description ?: entry.introduction|striptags|raw, false, { twitter: { image: tw.image ?: entry.image.first() }, facebook: { image: fb.image ?: entry.image.first() }, } ) %}
This will use the entry.image field by default and will override if an image is defined in the social tab.
Sorry, something went wrong.
craft.seo.custom
No branches or pull requests
Is it possible to have fallback images, similar to how we can define fallbacks for titles & descriptions using the seo.custom object?
e.g.
{% set seo = craft.seo.custom(entry.seo.title, entry.seo.description ?: entry.introduction, true) %}
Also, setting seo to the seo.custom object as above stops pulling through any social data.
The text was updated successfully, but these errors were encountered: