According to this article a good theme should have "no .phtml template files, except for those that were modified to support the new theme. (Usually this number will be very small.)"
So in an ideal world we could accomplish anything we need by modifying only CSS and the local.xml for a theme.
In the real world though, every client ends up requesting something that I end up having to modify the phtml templates to achieve.
For example, a client is working with a 3rd party company that has asked me to put a div in a very specific spot:
<?php echo $this->getChildHtml('global_notices') ?>
<div class="page">
<?php echo $this->getChildHtml('header') ?>
<div class="main-container col1-layout">
{{ The new HTML needs to go here, but there is no getChildHtml call }}
<div class="main">
<?php echo $this->getChildHtml('breadcrumbs') ?>
<div class="col-main">
I see only two options:
- add a call to $this->getChildHtml('my_block') (This requires modifying 1column.phtml, 2columns-left.phtml, 2columns-right.phtml and 3columns.phtml)
- add the block as a child of header, then use javascript to append/prepend it to the desired parent div location (This just seems like a hack to me; could cause FOUC)
I ended up going with the first option, but this is not upgrade proof. When/if those templates are changed in a future release, I'll have to manually merge the changes, so this is not an ideal solution to me.
What would you do in this situation?