Does Sprout SEO work with Neo fields?

I'm trying to create multiple fallbacks within a custom formatted element metadata field in Sprout, so I could just use one Sprout SEO field with element metadata for multiple significantly different sections.

For instance, something like this:

{% if object.comparisonPageBodyText %}{{ object.comparisonPageBodyText | striptags }}{% else %}{{ object.body | striptags }}{% endif %}

I tried this, and it doesn't appear to work with Neo fields.

Ideally, my ultimate thing would be something like:

  • If comparisonPageBodyText exists, use the first 160 characters
  • else use the first 160 characters of the first body matrix block
  • else use the section default
  • else use the site default

It would be amazing if we could structure the logic inside the gui instead of writing twig, but ultimately this would be fine if I could get it to work.

Your Answer

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

Browse other questions tagged or ask your own question.