Theme’s – Drupal Input Format and Filters

Starting last week, I was doing some research on drupal theming for version 6.x. While searching through the forum I ran across a post about conversions from a wordpress them to drupal.

I believe that by changing a theme we can really make it our own, yet even more important is the knowledge we learn about the system, the code, and much more about the cms system we are using.

Anyway back to the wordpress to drupal theming, I already had purchased the designer pack of wordpress themes from Revolutiontheme. The post I had found had references to the Revolution theme Music converted to a drupal 5.x and 6.x version carried out by bassbetot.

Now I was off to a great start with a template I liked. One of the challenges that cropped up immediately had to do with paragraph formatting. I knew enough to look the input formats, not thinking first to check a default template.

I did quite a bit of searching through the drupal site and the other various searches. After trying about every conceivable feature and reading every piece of information I could find about it the input format and filters. I came across several posts about how it could be a theme related, but there was no indication where in the theme.

Since I knew it worked in the previous theme, along with the base theme’s that came with Drupal 6, I began to search for differences between the theme’s.

Now before all you experienced Drupal coders start laughing, I was amazed that I could not find this information in anything I’d read. The Drupal site covers the input format and filters very well, yet I could not find where in the theme the problem could be located.

So after about half a day of reading and comparing code between the new theme and the old theme, “I was surely glad I have BBedit” to make this job easier. It suddenly came to me that this was a CSS issue, see I said not to laugh.

Using Firefox and the Firebug plugin made it very to track down the CSS code that I needed to change, to get the paragraph formatting back that I was looking for.

This was the code in the new wordpress to drupal css theme that needed to be modified:

#homepagebottom p {
font-size: 12px;
margin: 0px;
padding: 0px;

Was changed to this

#homepagebottom p {
font-size: 12px;
margin: 6px 0 6px 0;
padding: 0px;

The question in my mind was, why does this work in the wordpress format but not in Drupal? Then does it really matter? I always seem to know just enough CSS to get myself into trouble. Yet, if this helps just a few people dealing with formatting issues with their theme and drupal input format and filters it will be worth it!

Comments on this entry are closed.

  • Matt V. Sep 28, 2008 @ 15:26

    I suspect that the difference between how the CSS was being applied in WordPress versus Drupal has to do with the default formatting that Drupal adds. Drupal has some default CSS rules that it applies (as does WordPress, I believe) before the theme gets applied. Those defaults get applied, unless your default style.css file overrides them. By making the change you outlined above, you probably overrode the Drupal defaults.

    In the Firebug style pane, when you inspect an element, you may notice that some rules get crossed out, especially as you scroll down. Those are the rules that are being overridden.