Page 1 of 1

Banner on front page but remove on others

Posted: Sat Mar 20, 2010 9:01 pm
by SanSan
Hello all,
I have searched the forum for an answer to my question but I can't seem to find anything related to my problem. I'm trying to add a banner to the front of the page, I did it by adding a new div in "header.tpl" under the "breadcrumb" div and it worked and looks like this:

Click for preview

Now what I'm trying to do is when the user goes to a category I need to remove the banner so it looks like this:

Click for preview

Any quick solutions to this?

Re: Banner on front page but remove on others

Posted: Sat Mar 20, 2010 9:25 pm
by BISIdesigns
Put it in home.tpl instead of header.tpl.

The header.tpl is the top part of all pages. The home.tpl controls just the home page content.

Re: Banner on front page but remove on others

Posted: Sat Mar 20, 2010 9:32 pm
by Qphoria
1. EDIT: catalog/view/theme/YOURTHEME/template/common/header.tpl

2. Wherever you are showing that banner, put this if statement around it, like this:

Code: Select all

<?php if (!isset($this->request->get['route']) || $this->request->get['route'] == 'common/home') { ?>
<img src="your/banner/img">
<?php } ?>

Re: Banner on front page but remove on others

Posted: Sat Mar 20, 2010 9:49 pm
by SanSan
Wow you guys answer fast, got 2 solutions in 30 min ;D

BISIdesigns: yes it worked, just needed to add the div after <?php echo $header; ?> my div and then <?php echo $column_left; ?><?php echo $column_right; ?>. Why didn't I think of that? :P

Qphoria: Works great! Brilliant solution to my problem. :D

Thank you all!
Alex