Add striptags to meta description by default #59
Replies: 3 comments
-
@lexislav This can be done using the Element Metadata field Custom Format setting. I've considered adding it by default, or an option to have it in there by default but as the Rich Text fields are third party fields we probably couldn't be consistent about which ones we support. At the very least, I can add a better section in the docs for this common use case. When you choose Custom Format you can target your field and apply Twig filters just like Craft's Title Format field in Section settings.
|
Beta Was this translation helpful? Give feedback.
-
I’am aware of possibility to set this in SEO field and that I am working with this for now
{{ perex|striptags }}
But Ii cann’t hand down the SEO configuration to editor as this is bit too „advanced“ – here the idea to make this default.
But got Your point.
Thanks
… 11. 11. 2020 v 14:55, Ben Parizek ***@***.***>:
@lexislav <https://github.com/lexislav> This can be done using the Element Metadata field Custom Format setting.
I've considered adding it by default, or an option to have it in there by default but as the Rich Text fields are third party fields we probably couldn't be consistent about which ones we support. At the very least, I can add a better section in the docs for this common use case.
When you choose Custom Format <https://sprout.barrelstrengthdesign.com/docs/seo/element-metadata-field.html#field-settings> you can target your field and apply Twig filters just like Craft's Title Format field in Section settings.
shorthand syntax:
{customFieldHandle|striptags}
or object syntax:
{{ object.customFieldHandle|striptags }}
or multiple filters:
{customFieldHandle|striptags|slice(0, 150)}
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <https://github.com/barrelstrength/craft-sprout-seo/issues/230#issuecomment-725436378>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABWQ6VP2KG7ZABOWAXTKQSDSPKJUPANCNFSM4TPI5GYQ>.
|
Beta Was this translation helpful? Give feedback.
-
Ok, great. I'll update this to be an FR and see if we can consider a default option, at least for the common Craft Rich Text fields, in the future. |
Beta Was this translation helpful? Give feedback.
-
When redactor (or similar) field is used to generate SEO description, it includes HTML tags.
Would it be possible to add |striptags to seo template by default – as it has no sense to keep html tags in meta description?
Beta Was this translation helpful? Give feedback.
All reactions