Is there an easy way to get the first paragraph of a wysiwyg. In this instance I want to add it without the enclosing <p>
tags into a Facebook og:description
tag.
Add a comment
|
I used the hacksaw plugin:
{exp:eehive_hacksaw cutoff="</p>"}{copy}{/exp:eehive_hacksaw}
-
Glad you found a solution, but just NSM Better Meta or just a plain text-field in your field-group would have been cleaner IMO. – jrothafer Nov 28 '16 at 15:45
-
Yeah, this would include any HTML in the field, as well as images, tables, etc. And a WYSIWYG field doesn't necessarily have to contain any paragraphs. I'd suggest adding a plain textarea field for the Description. Or using an SEO plugin like SEO Lite. – Gary Reckard Nov 29 '16 at 17:38