I'm using the simular syntax as per #66 but it's not overriding the existing seo settings output.
I'm out case - we've got loads of commerce products, and unless an admin has specifically set a social image we want to use our mobile image - so our code is
{% set seo = product.seo %}
{%- if seo.social.facebook.imageId == '' -%}
{% set seo = product.seo %}
{% set seo = craft.seo.custom(
seo.title,
seo.description,
false,
{
twitter: { image: productData.bannerImageMobile.one },
facebook: { image: productData.bannerImageMobile.one },
}
) %}
{%- endif -%}
The logic abive is if the facebook image isn't specifically set, then the twitter image won't be either.
If I {{dump(seo)}} this data out in the template afterwards the imageId has been updated to the custom imageId as specified above, but in the html generated by the {% hook seo %} it's still either showing the default social image?
Steps to reproduce
1.
2.
Additional info
Craft version: Craft Pro 3.5.19.1
SEO version: 3.7.4
PHP version: 7.4.21
Database driver & version: MySQL 8.0.27
Other Plugins:
Amazon S3 1.2.11
Asset Usage 2.2.0.1
Control Panel CSS 2.3.0
Cookie Consent Banner 1.2.8
CP Field Inspect 1.2.4
Craft Commerce 3.1.12
eden-product-importer 1.0.1
Empty Coalesce 1.0.6
Feed Me 4.3.4
Field Manager 2.2.3
Imgix 2.1.0
PDF Transform 1.0.5
Redactor 2.8.5
SEO 3.7.4
Sidebar Shortcuts 1.0.0
Super Table 2.6.7
Tags 1.0.7
Twigpack 1.2.9
Typed link field 1.0.24
Description
I'm using the simular syntax as per #66 but it's not overriding the existing seo settings output.
I'm out case - we've got loads of commerce products, and unless an admin has specifically set a social image we want to use our mobile image - so our code is
The logic abive is if the facebook image isn't specifically set, then the twitter image won't be either.
If I
{{dump(seo)}}
this data out in the template afterwards theimageId
has been updated to the custom imageId as specified above, but in the html generated by the {% hook seo %} it's still either showing the default social image?Steps to reproduce
1. 2.
Additional info