Abstract
Adding content to a web site can be quite a chore when you have to format the information yourself. Conversely, making text input 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 post 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. Filters are almost always a single action such as “strip out all hyperlinks,” “add a random image to this post,” or even “translate this into pirate-speak” (see pirate.module at http://drupal.org/project/pirate).
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
Rights and permissions
Copyright information
© 2007 John K. VanDyk and Matt Westgate
About this chapter
Cite this chapter
(2007). Manipulating User Input: The Filter System. In: Pro Drupal Development. Apress. https://doi.org/10.1007/978-1-4302-0190-8_11
Download citation
DOI: https://doi.org/10.1007/978-1-4302-0190-8_11
Publisher Name: Apress
Print ISBN: 978-1-59059-755-2
Online ISBN: 978-1-4302-0190-8
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books