Using multiple names for the same blockthem-[mytheme].tpl

tombigel - November 29, 2008 - 09:03
Project:Block Theme
Version:6.x-1.0-beta1
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

I use Blocktheme alongside block-class module to create multiple styles for the same block structure, for example -

<div id="block-<?php print $block->module .'-'. $block->delta; ?>" class="block block-<?php print $block->module ?> <?php print $blocktheme; ?>-<?php print block_class($block); ?>">
    <div class="tl">
        <div class="tr">
            <div class="bl">
                <div class="br">
                    <div class="middle">
                        <?php if ($block->subject): ?>
                          <h2><?php print $block->subject ?></h2>
                        <?php endif;?>
                       
                          <div class="content">
                            <?php print $block->content ?>
                          </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

This way I can define blocktheme-border.tpl.php and apply other class names for it (like "gray-round" or "white-blue-header" etc.) to use in style.css.

It would be a nice feature to be able to have this feature embedded in Blocktheme.

My idea for implementing it is to use something like the Drupal tpl hierarchy -
Define several theme names that precede with the same name in Blocktheme Admin:

border|Template for round borders
border-blue|Blue border
border-gray|Gray border
border-none|no border

The module will look for blocktheme-border-[subtheme].tpl, If the file does not exist Blocktheme will fall back to blocktheme-border.tpl, but $blocktheme variable will print border-[subtheme].

 
 

Drupal is a registered trademark of Dries Buytaert.