Manipulating User Input: The Filter System

  • John K. VanDyk


Adding content to a web site can be quite a chore when you have to format the information by hand. Conversely, making textual content look good on a web site requires knowledge of HTML—knowledge most users don’t want to be bothered with. For those of us who are HTML-savvy, it’s still a pain to stop and insert tags into our posts during the middle of a brainstorm or literary breakthrough. Paragraph tags, link tags, break tags ... yuck. The good news is that Drupal uses prebuilt routines called filters to make data entry easy and efficient. Filters perform text manipulations such as making URLs clickable, converting line breaks to <p> and <br /> tags, and even stripping out malicious HTML. hook_filter() is the mechanism behind filter creation and manipulation of user-submitted data.


Filter System Input Format Gray Squirrel Creative Juice Jelly Bean 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© John K. VanDyk 2008

Authors and Affiliations

  • John K. VanDyk

There are no affiliations available

Personalised recommendations