User login

phptemplate

You are here

Popular Themes

phptemplate

Want your theme to be compatible with Context module? Better check your theme_blocks

I got a bug report for the Syan theme today about problems with openpublish - all the blocks were gone.

I hadn't tried openpublish before so I decided to check it out. Wow! A 10 megabyte Drupal distribution, including well over a hundred contrib modules. Furthermore, this distribution bypasses the Drupal block system and uses the Context module instead.

After deleting some fix in my theme's code I discovered that theme_blocks was the culprit. I checked the Context module code and found that Context was overriding theme_blocks! It uses this to output block content through it's own system, unfortunately there appears no other way to hook into the block content other than using the theme function.

If you want your theme to be compatible with the theme_blocks function in your theme, you're going to have to add some code, as commented by the Context developer yhahn in context.core.inc:

// Reroute theme_blocks() through context_blocks to determine block
// visibility by context. Only override theme_blocks() if a theme
// has not overridden it. It is the responsibility of any themes
// implementing theme_blocks() to take advantage of context block
// visibility on their own.

Thus if your theme overrides theme_blocks you're going to have something like this:

Author:JurriaanRoelofs

Datum:4-12-'07

Theming Drupal Comments, Exemplifying with Garland

Part 1 - enhancing the
comment layout

When browsing the drupal showcase forum I notice that few people
take the effort the theme the comments, which is strange because comments are
not only a very popular feature, but also exceedingly easy to theme!. For this
comment theming tutorial we're going to spice up the comment template of the
default Garland theme with some additional styling and a date widget just like the one in my latest free drupal theme Delicious Fruit.

Subscribe to RSS - phptemplate