1

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.

1 Answer 1

2

I used the hacksaw plugin:

{exp:eehive_hacksaw cutoff="</p>"}{copy}{/exp:eehive_hacksaw}

2
  • 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
    Commented Nov 28, 2016 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. Commented Nov 29, 2016 at 17:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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