The best way to explain this is with modules
A module "should" simply plug in to any store and any theme dynamically. But they do not. Each module has its own template file, and that file comes with "box" wrappers. This is a mistake. If someone makes a theme and changes this "box" style, they have to change this file as well.
Modules should NOT have this outer box wrapper in their template files. It removes the concept of a "template" if they all supply their own box code. They should fit into the normal column_right.tpl structure and only include the contents inside of <div class="middle">
The column_right should then instead of:
Code: Select all
<div id="column_right">
<?php foreach ($modules as $module) { ?>
<?php echo ${$module['code']}; ?>
<?php } ?>
</div>
Should be:
Code: Select all
<div id="column_right">
<?php foreach ($modules as $module) { ?>
<div class="box" id="module_<?php echo $module_name; ?>">
<div class="top"><?php echo $heading_title; ?></div>
<div class="middle">
<?php echo ${$module['code']}; ?>
</div>
<div class="bottom"> </div>
</div>
<?php } ?>
</div>
Now when people make templates, the module will automatically fit with their theme without needing to edit this file.
By using the id with the module name in it, we can still use css to give things like different colors with css