I currently have a static block that appears in the left column. I'm looking to have it display at the top of the page instead.
Is there an easy way to do this or do I need to delete and start over?
I currently have a static block that appears in the left column. I'm looking to have it display at the top of the page instead.
Is there an easy way to do this or do I need to delete and start over?
The first thing you'll need to do is find the static block in the layout XML files. It's probably located in your active templates local.xml
, you can recognize it by it's identifier. It'll look something like this
<reference name="left">
<block type="cms/block" name="some_name">
<action method="setBlockId"><block_id>[identifier-as-set-in-backend]</block_id></action>
</block>
</reference>
Now take the whole <block/>
part from the left reference, we'll add it to a new reference. Find the <default/>
node and search for the <header/>
node in there, if it doesn't exist create it. Now add the copied <block/>
node in there. It would look something like this
<default>
<reference name="header">
<block type="cms/block" name="some_name">
<action method="setBlockId"><block_id>[identifier-as-set-in-backend]</block_id></action>
</block>
</reference>
</default>
Now open up the header.phtml
file in your template. It should be located under app/design/frontend/[templatename]/[packagename]/template/page/html/header.phtml
In there, find the place you want to add the block and add
<?php echo $this->getChildHtml('some_name');?>
There are several ways to add static blocks to the left column, the easiest one that's usually used by theme developers and forgotten by everybody else is Widget Instances.
In the admin panel, go to CMS > Widget Instances and filter by Type "CMS Static Block". Go through them and check the "Widget Options" tab if you find the name of your static block.
If you found it, go to the "Frontend Properties" tab and change "Left Column" to "Page Top" (You can also try "Page Header" or "Navigation Bar" if it should not be right at the beginning of the body element):
Save, clean the cache and you're done.