In drupal 4.7, I have multiple text areas on a single node form. How do I let the user choose different filters for the two (or more) text areas?

Thanks. -Dave

Comments

morbus iff’s picture

Is this is your own module, or in something like flexinode? Take a look at how it's being done in ">Flexinode's textarea (something I just fixed today, as a matter of fact):

  1. Every textarea has its own FormAPI "branch".
  2. Each branch has two leaves: the body, and the filter.
  3. The call to filter_form includes the name of the branch.

http://www.disobey.com/
http://www.gamegrene.com/

Dave Cohen’s picture

Morbus, It's my own module. Thanks for your feedback.

Flexinode does a good deal more than you describe. To use different filters, you also have to:

  1. Save the extra filter settings with the node
  2. During hook_view, call check_markup() for each of the textareas / filters.

For my case, it turns out easier to just apply the one node filter to my extra textareas. So all I had to do is call check_markup() for each of my textareas during hook_view. At least I hope that's all I have to do!