Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Apress.Pro.Drupal.7.Development.3rd.Edition.Dec.2010.pdf
Скачиваний:
73
Добавлен:
14.03.2016
Размер:
12.64 Mб
Скачать

CHAPTER 12 MANIPULATING USER INPUT: THE FILTER SYSTEM

Once this module is enabled on the modules page, the creativejuice filter will be available to be enabled for either an existing Text format or a new Text format. For example, Figure 12-7 shows what the “Text format” section of the node editing form looks like after the creativejuice filter has been added to the Full HTML Text format.

Figure 12-7. The Full HTML Text format now contains the creativejuice filter, as indicated by the preceding section of the node editing form.

You can create a new blog entry with the correct Text format and submit text that uses the [juice!]

tag:

Today was a crazy day. [juice!] Even if that sounds a little odd, it still doesn't beat what I heard on the radio. [juice!]

This is converted upon submission to something like the following:

Today was a crazy day! Generally speaking, life flowed in its accustomed stream through the red tape of officialdom. Even if that sounds a little odd, it still doesn't beat what I heard on the radio. Barren in intellect, reverting to another matter like a damp-handed auctioneer.

Summary

After reading this chapter, you should be able to

Understand what a filter and a Text format are and how they are used to transform text.

Understand why the filter system is more efficient than performing text manipulations in other hooks.

Understand how Text formats and filters behave.

Create a custom filter.

Understand how the various filter operations function.

305

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]