Forums / Templates, Stylesheets, Page Layout / How to Create Top Banner?

How to Create Top Banner?

Started by nasios on 9 Dec 2011, 8:09 AM · Views: 3,673

Results 1 to 20 of 20
9 Dec 2011, 8:09 AM
#1
nasios avatar

nasios

New Zenner

Join Date:
Oct 2011
Posts:
19
Plugin Contributions:
0

How to Create Top Banner?

I tried really hard to find an answer to this before posting because it seems so easy, however, I can't figure this out for the life of me... I want to create a banner across the top of my site.

I've uploaded a banner image and created its own banner group in the banner manager. I then added the banner group name to 'Banner Display Groups - Header Position 1'. This should be it right? I should then see a banner over the top of my site, or am I missing something?

www.giftbasketsforever.com
Version 1.3.9h

9 Dec 2011, 11:25 AM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: How to Create Top Banner?

That should place your image above the mainwrapper, if the image is in the path you specified when you created the banner. I would double-check that path first.

9 Dec 2011, 4:22 PM
#3
redwater avatar

redwater

New Zenner

Join Date:
Nov 2011
Posts:
7
Plugin Contributions:
0

Re: How to Create Top Banner?

Hi

Did it appear in the center box?

I'm fairly new to this and someone far more qualified will be along shortly with a bit of luck. However, this is what I have done so far (a work in progress - please please back up your files!) to move the banner I created, from the the center position on in the main center box, to the top right next to / opposite my logo.

Maybe you can play with it and figure out the rest from here I don't know, but like I say, I'm pretty new to this lark so please please back up all files.

Here is is... I removed this from file tpl_index_default.php

**<?php if (SHOW_BANNERS_GROUP_SET1 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1)) { if ($banner->RecordCount() > 0) { ?>

<div id="bannerOne" class="banners"><?php echo zen_display_banner('static', $banner); ?></div> <?php } } ?>**

and added it to file tpl_header.php inbetween

<!--bof-branding display-->

and

<!--eof-branding display-->

Like this...

<!--bof-branding display--> <div id="logoWrapper"> <div id="logo"><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?> ** <?php if (SHOW_BANNERS_GROUP_SET1 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1)) { if ($banner->RecordCount() > 0) { ?> <div id="bannerOne" class="banners"><?php echo zen_display_banner('static', $banner); ?></div> <?php } } ?>** </div> </div> <div class="clearBoth"></div> <!--eof-branding display-->

Hope this is helpful and my sincere apologies if it is flawed advice.

Cheers

Matt

9 Dec 2011, 6:10 PM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How to Create Top Banner?

The stock banner group 1 code is in /includes/templates/your_template/common/tpl_main_page.php (right after the <body> tag), not in tpl_index_default.php.

You can move it to tpl_header.php if you specifically want it not to be above the entire header div, but inside the header div.

10 Dec 2011, 12:55 AM
#5
nasios avatar

nasios

New Zenner

Join Date:
Oct 2011
Posts:
19
Plugin Contributions:
0

Re: How to Create Top Banner?

stevesh:

That should place your image above the mainwrapper, if the image is in the path you specified when you created the banner. I would double-check that path first.

The image file is in the path. I uploaded the image into another banner that's already displaying to be absolutely sure.

It appears that the only banners that display on my site are the two on my home page (BannerOne and BannerTwo group names). I can't get any other banner in banner manager to show up anywhere on my site.

The weird thing is that I don't see BannerOne or BannerTwo group names anywhere on the Layout Settings page. Aren't I supposed to see the banner group next to one of the 'Banner Display Group' lines?

10 Dec 2011, 1:01 AM
#6
nasios avatar

nasios

New Zenner

Join Date:
Oct 2011
Posts:
19
Plugin Contributions:
0

Re: How to Create Top Banner?

By the way I tried multiple group names on the Header Position 1 just to be sure and I can't get anything to show.

Banner Display Groups - Header Position 1 test:bannerOne:bannerTwo

10 Dec 2011, 1:23 AM
#7
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How to Create Top Banner?

Apparently there is at least one custom template that has removed banner group 1 from its top-of-the-screen position, either to put it elsewhere or delete it. Seeing your site live may help us diagnose your situation.

10 Dec 2011, 1:30 AM
#8
nasios avatar

nasios

New Zenner

Join Date:
Oct 2011
Posts:
19
Plugin Contributions:
0

Re: How to Create Top Banner?

gjh42:

Apparently there is at least one custom template that has removed banner group 1 from its top-of-the-screen position, either to put it elsewhere or delete it. Seeing your site live may help us diagnose your situation.

Thank you. Site is live... www.giftbasketsforever.com

10 Dec 2011, 1:49 AM
#9
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How to Create Top Banner?

Banner group 1 has been moved from top of screen to bottom of header, at the left of the slider. The only banner group comment tags I see are for banner group 5, just above the footer. If you don't plan to use that, you could move it to the top in tpl_main_page.php as described above.

10 Dec 2011, 2:40 AM
#10
nasios avatar

nasios

New Zenner

Join Date:
Oct 2011
Posts:
19
Plugin Contributions:
0

Re: How to Create Top Banner?

gjh42:

The stock banner group 1 code is in /includes/templates/your_template/common/tpl_main_page.php (right after the <body> tag), not in tpl_index_default.php.

You can move it to tpl_header.php if you specifically want it not to be above the entire header div, but inside the header div.

gjh42:

Banner group 1 has been moved from top of screen to bottom of header, at the left of the slider. The only banner group comment tags I see are for banner group 5, just above the footer. If you don't plan to use that, you could move it to the top in tpl_main_page.php as described above.

I'm very new to Zen Cart and I want to make sure I understand this before I attempt this...

I'm going to cut the banner group 1 code in /includes/templates/your_template/common/tpl_main_page.php and paste it in tpl_header.php?

Then I'm going to use banner group 5 for the banner and place the group name on Banner Display Groups - Header Position 1 under display settings?

10 Dec 2011, 3:20 AM
#11
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How to Create Top Banner?

Probably not. We would have to see what banner code you have where (in the PHP files) before advising how best to modify your already-modified template.

The banner group 1 code will correspond with Header Position 1 settings, and the banner group 5 code will correspond with (I think) Footer Position 2 settings, no matter where on the page those are actually showing.

10 Dec 2011, 9:30 PM
#12
nasios avatar

nasios

New Zenner

Join Date:
Oct 2011
Posts:
19
Plugin Contributions:
0

Re: How to Create Top Banner?

Is it possible for you to walk me through the steps?

Or is there a resource you recommend?

10 Dec 2011, 11:25 PM
#13
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How to Create Top Banner?

Because your template has parts moved around and changed so much, we need to see your tpl_main_page.php and possibly tpl_header.php files to know where the banner code is now. Only then can we be sure of what you need to do.

11 Dec 2011, 8:24 AM
#14
nasios avatar

nasios

New Zenner

Join Date:
Oct 2011
Posts:
19
Plugin Contributions:
0

Re: How to Create Top Banner?

gjh42:

Because your template has parts moved around and changed so much, we need to see your tpl_main_page.php and possibly tpl_header.php files to know where the banner code is now. Only then can we be sure of what you need to do.

Sent you the files.

11 Dec 2011, 2:52 PM
#15
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How to Create Top Banner?

That is about the most hacked-up page structure I have seen:) They couldn't even be satisfied with turning off the right column with admin settings, but had to delete every bit of template code for it. You couldn't have a right column if you wanted to.

Anyway, it looks like banner positions 1,2 & 3 are all occupied in your layout below the header. Banner 5 is apparently in tpl_footer.php, so you could move the code block for that to tpl_main_page.php, just below the <body id=... code.

11 Dec 2011, 8:09 PM
#16
nasios avatar

nasios

New Zenner

Join Date:
Oct 2011
Posts:
19
Plugin Contributions:
0

Re: How to Create Top Banner?

gjh42:

That is about the most hacked-up page structure I have seen:) They couldn't even be satisfied with turning off the right column with admin settings, but had to delete every bit of template code for it. You couldn't have a right column if you wanted to.

Anyway, it looks like banner positions 1,2 & 3 are all occupied in your layout below the header. Banner 5 is apparently in tpl_footer.php, so you could move the code block for that to tpl_main_page.php, just below the <body id=... code.

I sent you the footer code. Can you tell me exactly what chunk of code I'll be moving to tpl_main.php?

12 Dec 2011, 3:09 PM
#17
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How to Create Top Banner?

<?php

if (!$flag_disable_footer) {

?>

<!-- ========== FOOTER ========== -->



<!-- BOF- BANNER #5 display -->

<!-- EOF- BANNER #5 display -->

<div id="footer">

<div class="main-width1">

Now that's convenient... your template's maker decided that nobody needs to use banner #5, so they deleted its code.

You can find the original code in the /template_default/ version of tpl_footer.php; copy everything between (and including the comments)
<!-- BOF- BANNER #5 display -->
and
<!-- EOF- BANNER #5 display -->
into tpl_main_page.php as described above.

13 Dec 2011, 6:06 AM
#18
nasios avatar

nasios

New Zenner

Join Date:
Oct 2011
Posts:
19
Plugin Contributions:
0

Re: How to Create Top Banner?

It worked perfectly. Thank you.

Will I ever be able to place banners on other areas (like below the top menu) without serious mods to this template?

13 Dec 2011, 10:08 AM
#19
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How to Create Top Banner?

There should be banner 6 code somewhere in the footer area (maybe at the bottom of tpl_main_page,php), and you could move that if you needed to.

13 Dec 2011, 7:41 PM
#20
nasios avatar

nasios

New Zenner

Join Date:
Oct 2011
Posts:
19
Plugin Contributions:
0

Re: How to Create Top Banner?

Awesome. Thank you.