I would love to see a header block for this template, rather than the header image inserted into the background of the page as it is now. This would make controlling where the header appears and what's in it very easy.

CommentFileSizeAuthor
#3 ShutterFreak Snapshot.jpg60.02 KBShutterFreak
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Sungsit’s picture

Oops! I'm really really sorry for leaving the project(s) for a long long time. Hope I have a time to improve the theme for many feature requests soon.

Thank you,
Gibbozer

ShutterFreak’s picture

I have been doing this while customizing the Colourise theme on my site. I attached a screenshot to this post so you can see how it looks like.

Instead of creating a subtheme, I decided to hack the Colourise theme as follows:

  1. Edit 'page.tpl.php' of the Colourise theme (should be in 'sites/all/themes/colourise/page.tpl.php'), and add a new header region by inserting the following code:

            <?php if ($header_banner): ?>
              <div id="header_banner" style="width: 100%; height: 200px; position: absolute; top: 0px; left: 0px">
                <?php print $header_banner ?>
              </div>
            <?php endif; ?>
    


    If you don't add this "if ($header_banner)" check, then you won't be able to display whichever content you assign to this region, as Drupal will have no clue where content for this new region should be pasted in the page!

  2. Edit 'colourise.info' by adding a new 'header_banner' region to the template. This can be done by simply adding the following line to the .info file:
    regions[header_banner] = Header banner
  3. Upload the edited template files to your Drupal environment, basically overwriting the existing files. It is wise to keep the original copies as backup files should you ever want to revert your edits.
  4. Clear the theme registry. If you have the devel module installed, just click on "clear cache"; otherwise go to admin»settings»performance and click the "clear cache" button at the bottom of that page.
  5. Create a block (admin»build»block), set its input format to PHP and HTML (to prevent the WYSIWYG editor from kicking in) with HTML (and PHP) code for the block.
  6. Place the block in the newly defined region (header_banner) and hit "Save".

That's it :)

A more clean approach is to define a new sub-theme of the Colourise theme, and keep your changes in that new sub-theme. This is how I will refactor my customizations now.

Hope this helps!

ShutterFreak’s picture

FileSize
60.02 KB

Here's the promised snapshot.

verta’s picture

I am about to try to overlay the header with 2-3 regions. I need them to "float" above the image. I like the idea of having a region or two for blocks to the right of the site name/tagline!

ShutterFreak’s picture

The simplest solution that could possibly work is using transparent regions that float above the header. Defining the height in pixels and the width in terms of the screen dimensions offered by Colourise should be straightforward.

mikejonesok’s picture

You my friend are TOTALLY AWESOME! Thanks for the simple and easy tut.

ShutterFreak’s picture

You're welcome :)

yashadev’s picture

Status: Active » Closed (fixed)

This future is currently (hopefully, if I get the co-maintainer rights) is being implemented into the 7.x-2.x branch