1

I'm using SEOmatic plugin in craft cms 3 and I need to set the seoTitle in my template but can't figure out how to do it...

I know that in Craft 2, it was possible to merge the seomatic variable. I tried something like this :

{% set seomatic = seomatic|merge({
    meta: {
        seoTitle: 'my title'
    }
}) %}

But it doesn't work because the merge filter only works with arrays or "Traversable", and I got object... I'm kind of stuck with this issue.

Has anyone ever managed to make a merge of seoTitle?

2

Based on the SEOmatic docs, something like this should do the trick nicely:

{% do seomatic.meta.seoTitle("my title") %}
  • 1
    Okay I feel really dumb to have missed this part of the doc... It worked thank you very much ! – Elodie Grondin Jan 9 at 12:54
  • No worries! To be completely honest, Andrew's plugin docs are a bit hard to go through since they're just one long README. Personally, I would love to see the docs migrated to his website where they could be organized a little better (using Vuepress or something similar). Would be easier to find and navigate to the section you want to read about... – Jalen Davenport Jan 9 at 14:02
  • 1
    I agree. And that's exactly what I plan to do @JalenDavenport – andrew.welch Jan 10 at 0:54
  • Lol - I wondered if you would see this 😂 Thanks! 🙏 – Jalen Davenport Jan 10 at 2:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.