I'm stuck following the instructions in David Mercer's Drupal book on creating a PHP-enabled input format.

The book tells me to create an input format called "special pages" with these filters:

  1. PHP evaluator
  2. HTML filter
  3. Line break converter
  4. URL filter
  5. HTML corrector

Then, it tells me to add content which includes CSS:

<div style="text-align: center;">
<strong>The MF4Good</strong>
</div>

But when I get the rendered page, the CSS is always filtered out. Probably by the HTML filter ?! Is there a way to enable CSS, other than disabling the HTML filter altogether ?

Comments

cog.rusty’s picture

Besides disabling the HTML filter, you can configure it and add more allowed html tags to it.

catweazle’s picture

How do I allow
style="text-align: center;"

cog.rusty’s picture

If it works like any other tag, you should simply allow the <style> tag.

However, it seems more in the spirit of css to predefine your styles with classes and ids and not to allow users to apply any styles they want in the content.

catweazle’s picture

Cool, I'll try it out. Thanks !