This is the website of Andy Carter a Textpattern and Drupal web developer living in the Steel city.

Using the Drupal teaser break with filtered HTML in Drupal 7

A quick Drupal 7 tip for anyone trying to use the Drupal teaser break (<!--break-->) with an input format other than full HTML: to ensure that the teaser break is observed HTML comments need to be included in the allowed HTML tags so that they are not filtered out of the content. You can do this by adding <!--> to the allowed tags of your input format (Configuration > Text formats).

Drupal 7

Once this is in place whenever the "teaser" display is used only content upto the teaser break will be output and Drupal will include the standard "read more" link to the node.


Comment

  1. You just saved me hours of searches and useless coding. Thanks.

    Sometimes Drupal has so many ways to do the same thing (here cleaning HTML) that it becomes difficult to debug a site.

    wagaf · Tue Jan 10, 07:46 PM

  2. Glad it helped wagaf.

    Andy · Wed Jan 11, 11:51 AM

Want to comment?

To comment you'll need to provide an e-mail address. Don't worry all e-mail addresses are kept private and will never be shown on this site or distributed to others.

Don't forget the http:// part

You'll need to preview your comment before it can be submitted; this is to help prevent spam and to give you a chance to review your comment before it gets posted on the site.

Comment formatting:

_emphasis_
*strong*
??citation??
-deleted text-
+inserted text+
^superscript^

Hyperlink:
"link text":http://link.com/

To define an acronym:
ABC(Always Be Closing)

Note: All (X)HTML tags will be escaped.