Dynamically Styling Modules and Blocks in Drupal 6
The default templates and themable functions contribute a good deal to the productivity on a Drupal site, and several are positioned on the page through the assignment of blocks to regions. Today we will focus mainly on how to control the formatting of a site’s various modules and blocks.
1. Dynamically Styling Blocks:
Block output is controlled by the block.tpl.php template. As in other areas, PHPTemplate will look to the names given to multiple template files to determine which template to display. The order of precedence used for the block template is consistent with that used elsewhere.
• you can provide a template to apply to the blocks of a specific module of a specific delta `(block-modulename-delta.tpl.php)`.
• You can also attach a template to blocks of a module by module name `(block-modulename.tpl.php)`, or to the blocks of a particular region `(block-regionname.tpl.php)`.
• If nothing is specified, the system applies the default `block.tpl.php` template.
If you are not certain of the attribution of your block, that is, the name of the module that produces the block or the block’s delta, try using the Theme Developer feature of the Devel module. If you have the Devel module installed on your site, you can yield information in the form of a list of suggestions quite effortlessly
• Install the Devel module.
• Activate the Theme Developer option.
• Open your browser and go to the page where your block appears.
• Click the **Themer Info** checkbox on the bottom left of the screen, then click on the block in question.
When you click on the element, a pop up will appear:

2. Dynamically Styling the Forum Module:
The base template of the forum module is `forums.tpl.php`. There are several suggestions for both forum containers and topics:
3. Dynamically Styling the Polls Module:
The Polls module is the subject to a number of default templates. There are default suggestions available for all the key templates:

4. Dynamically Styling Nodes:
PHPTemplate provides an explicit template for nodes—`node.tpl.php`. In the absence of a more specific template, the system will apply the default `node.tpl.php` file. The table below shows the suggestions for the default system:
Latest posts by Sandipan Bhattacharjee
- How to make a lightbox in a very simple way - August 19th, 2011
- How to Create Drupal Sub-themes from scratch - July 12th, 2011
- Zend framework step by step tutorial (Folder structure) - March 21st, 2011
- Zend Framework variables - March 21st, 2011
- Zend Framework Database Query - March 21st, 2011


