DRUPAL: Broken Teaser (or body) Text Showing Up at the Top of Page.

The output of some of the webpages was spilling out at the top of the page as broken HTML. I knew that the body or teaser was somehow getting printed out prior to the body loading. At first, a friend suggested that the problem was unfiltered use of the $vars[‘node’]->body in the Organic Groups module. It turned out to be unfiltered output of the $vars[‘node’]->teaser (could just as well been the body) was being used by some meta tag creating logic for a facebook comment button. The broken code was in the template.php file.

The fix was simple. All I had to do was add PHP’s strip_tags() function to filter out the HTML that was finding its way into the META tag like this:


Problem solved! I hope this was helpful for someone.

Leave a Reply

Your email address will not be published. Required fields are marked *