1

I have noticed that text filters placed in the summary area don't seem to work, that the raw text appears in the summary info when posted in Twitter, Facebook and the like.

Is that some inherent problem in the summary area, or is it something like the Metatag filter that sends the unfiltered text directly to Twitter and Facebook?

I will check whether the Metatag output can be filtered in the mean time.

1 Answer 1

1

Text filters should definitely work in the Summary. You can test this by creating a View that uses the formatter "Summary" or "Summary or Trimmed" and using an input format like Plain Text in the Summary. HTML tags should be stripped from your View.

It sounds like something else is at play here.

Edit your Content Type (Structure > Content Types > Your Content Type) and look for the field in question (probably the Body field.)

Make sure Text Processing is set to "Filtered Text (user selects text format)" and the "Summary input" box is checked.

In the "DEFAULT VALUE" fieldset, select the desired Text format (e.g., Full HTML).

EDIT:

I'm sorry, you are correct. The built-in summary is just a summary and it does not support text filters. HTML in that field will be stripped.

This thread on Drupal.org says this won't be fixed until Drupal 9:

https://www.drupal.org/project/drupal/issues/1529188

The workaround is to create a new field called "Summary" and set its text format to the desired WYSIWYG format:

Adding a new Summary field

Then, manage the display of your content type to hide the new field from the Default view mode.

In the Teaser view mode, hide the Body field and show the Summary field instead.

The other solution is to edit the "Filtered HTML" text format to allow the <span> tag and other HTML that you require.

Honestly, it's a bit ridiculous that you have to do this to get what you want. I guess it's just one more reason to look forward to Drupal 9!

4
  • The problem is that the drop down to set the text filter is not displayed for the summary text input. Do you know where that is configured, at least for Drupal 7
    – vfclists
    Commented Nov 29, 2018 at 11:05
  • I updated my answer to answer your new question. Commented Nov 29, 2018 at 17:38
  • I have checked. The Summary text box does not have the option of selecting the text format, unless it is borrowed from the one set for the Body
    – vfclists
    Commented Dec 6, 2018 at 20:15
  • 1
    I was totally wrong! That's what I get for not testing it out. I fixed my answer above! Commented Dec 7, 2018 at 0:40

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.