Book Image

Learning Drupal 6 Module Development

Book Image

Learning Drupal 6 Module Development

Overview of this book

Table of Contents (14 chapters)
Learning Drupal 6 Module Development
Credits
About the Author
About the Reviewers
Preface

Creating Filters and an Input Format


Earlier, we created a new content type for the news brief that will be included at the top of each site news message.

However, there are a few things that we want to change about the content of a news brief node:

  1. 1. When we send the content out in an email message, we want to make sure that the HTML is removed from the news brief. In short, we want plain text. Drupal's check_plain() function seems a likely candidate for this task, but it escapes HTML instead of removing it. We want to remove the HTML.

  2. 2. There are a couple of common pieces of information that will likely appear in all of our content, but which we might want to change periodically. For example, the greeting and the name of the newsletter. We want to create placeholders for this information, and have Drupal replace the placeholders with meaningful text as needed.

The first task involves removing unwanted content. The second task involves adding content. But both of these can be done with filters...