Closed alanski66 closed 6 years ago
Looks fine to me; are you sure the code actually runs?
Try putting just this with no conditionals:
{% do seomatic.meta.description("Some Description") %}
... and then clear the SEOmatic caches, and view the source. lmk
Thanks. Just to check my understanding - custom 'do' calls to seomatic that are present in the template should override everything right?
On this basis that code doesn't look like it runs for facebook or standard meta
{% do seomatic.meta.ogDescription("moo cow") %} {% do seomatic.meta.description("Some Description") %}
None of the above outputs anything in meta data after cache cleared. Have tried this in multiple places in template but never see the override output. Updated to 14/7 release too. Am I misunderstanding how this is meant to work?
OK solved now. Total misfire on my end after small change to development environment and looking at the wrong templates. Thanks Andrew for patience and great tool
Great. glad you got it sorted!
So using a switch for entry.type {% switch entry.type %} {% case 'oldnews' %} {% set asset = entry.oldNewsImage.one() %} {% do seomatic.meta.ogDescription("{entry.body}") %} {% do seomatic.meta.ogImage("{asset.url}") %}
{% case 'news' %} {% set asset = entry.image.one() %} {% do seomatic.meta.ogDescription("{entry.newsIntro}") %} {% endswitch %}
Then using below to render different meta ogImage based on switch {% do seomatic.meta.ogImage("{asset.url}") %}
No og:image is output asset.url definitely has a value
Am I using this correctly?