Forums / Basic Configuration / How do i make banner ads appear on the front page only?

How do i make banner ads appear on the front page only?

Views: 28,387

Results 41 to 60 of 66
8 Feb 2009, 8:21 PM
#41
myworld20091 avatar

myworld20091

New Zenner

Join Date:
Oct 2008
Posts:
85
Plugin Contributions:
0

How do i make banner ads appear on the front page only?

ok, got it. i didnt notice the answer from above :laugh:

22 May 2009, 1:01 AM
#42
dave_nextexit avatar

dave_nextexit

New Zenner

Join Date:
Mar 2008
Posts:
57
Plugin Contributions:
0

Re: How do i make banner ads appear on the front page only?

Post #19 in this thread appears to be working perfectly...thanks!

24 Sep 2009, 9:30 PM
#43
jemilie avatar

jemilie

New Zenner

Join Date:
Sep 2009
Posts:
3
Plugin Contributions:
0

Re: How do i make banner ads appear on the front page only?

I am also trying to make the banners only appear on the home page. I tried all of the suggestions offered in the previous posts, and I have not yet had any luck. The website is https://www.thestorehg.com

Thanks.

<!--bof- banners display --> <?php if (SHOW_BANNERS_GROUP_SET1 != '' &&($banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1))&&$this_is_the_home_page ){ if ($banner->RecordCount() > 0) { ?> <div id="bannerOne" class="banners"><?php echo zen_display_banner('static', $banner); ?></div> <?php } } ?> <!--eof banners display--> <!--bof- banner #6 display --> <?php if (SHOW_BANNERS_GROUP_SET6 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET6)) { if ($banner->RecordCount() > 0) { ?> <div id="bannerSix" class="banners"><?php echo zen_display_banner('static', $banner); ?></div> <?php } } ?> <!--eof- banner #6 display -->
16 Nov 2009, 5:14 PM
#44
kburner avatar

kburner

Totally Zenned

Join Date:
Apr 2008
Location:
Flint, Michigan
Posts:
684
Plugin Contributions:
0

Re: How do i make banner ads appear on the front page only?

kuroi:

Re-read post 19 above. Also, I had relocated some of the banners in the code that I quoted above in order to place them where my client needed them, so your code will be a little different.

I am trying to get this to work. I keep getting a blank page. Used post 19 code. Input code into includes/template/xxx/common/tpl_main_page and get blank page. I only want banners on main page. I am using banner set 3.

<?php if (SHOW_BANNERS_GROUP_SET3 != '' && $this_is_home_page && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3)) { ?> <div id="bannerThree" class="banners"><?php echo zen_display_banner('static', $banner); ?></div> <?php } } ?>

kburner
Burner Christian Bookstore
https://www.burnerbooks.com

18 Nov 2009, 2:44 AM
#45
renz avatar

renz

Zen Follower

Join Date:
Jun 2006
Posts:
439
Plugin Contributions:
0

Re: How do i make banner ads appear on the front page only?

Hi I have a similar issue I am not able to resolve.

I would like to remove the main banner from all pages except the index page....

It is zen vs 138a and the banner is called header_banner.jpg it lives in the middle of the web site page on all pages. I can turn it on and off in the banner manager but that it.

The site is https://www.adulttoys4u.com.au/shop (Adult Toys Over 18s)

Thanks in advance.

Renz

15 Mar 2010, 5:46 AM
#46
jimmyyu1998 avatar

jimmyyu1998

New Zenner

Join Date:
Feb 2008
Posts:
14
Plugin Contributions:
0

Re: How do i make banner ads appear on the front page only?

Hi, I have same problem. I tried to put the banner ad only the first page, but it shows in every webpage you open.

Any body can help.

mywebsite is https://www.smartprinting.com.au,

Thanks

Jimmy

18 Aug 2010, 4:31 PM
#47
kaafum avatar

kaafum

New Zenner

Join Date:
Oct 2009
Posts:
55
Plugin Contributions:
0

Re: How do i make banner ads appear on the front page only?

Hi guys and girls,

I really tried everything and read every single post in this and other threads, but I can't get to a solution. My center banner appears on every page and I only need it on the homepage. I opened up tpl_main_page.php and added the following, but it still shows my center banner on all pages. What is it that I am missing here??? Don't have any other option than to ask here... please help...

<?php if (SHOW_BANNERS_GROUP_SET3 != '' && $this_is_home_page && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3)) { if ($banner->RecordCount() > 0) { ?> <div id="bannerThree" class="banners"><?php echo zen_display_banner('static', $banner); ?></div> */?> <div id="imgcontainer"> <img src=http://www.hollandalarm.nl/includes/templates/custom091/images/overzicht.jpg title="Overzicht" rel=http://www.hollandalarm.nl> <img src=http://www.hollandalarm.nl/includes/templates/custom091/images/Semplice.jpg title="Semplice" rel=http://www.hollandalarm.nl/alarmsysteem-huis/draadloos-alarmsysteem-semplice-p-180/> <img src=http://www.hollandalarm.nl/includes/templates/custom091/images/Avanzato.jpg title="Avanzato" rel=http://www.hollandalarm.nl/alarmsysteem-huis/draadloos-alarmsysteem-avanzato-p-181/> <img src=http://www.hollandalarm.nl/includes/templates/custom091/images/Professionale.jpg title="Professionale" rel=http://www.hollandalarm.nl/alarmsysteem-huis/draadloos-alarmsysteem-professionale-p-187/> </div> <div id="showCarousel"></div> <?php /* } } */?>
18 Aug 2010, 4:39 PM
#48
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: How do i make banner ads appear on the front page only?

@kaafum

It looks as though the code you've posted is incomplete. I can see a php block comment terminator just after the condition you have added, suggesting that the home page restriction you have added is in the middle of code that is ignored. If that comment block is started earlier (rather than being superfluous) it would explain why your restriction isn't having any effect.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

18 Aug 2010, 5:14 PM
#49
kaafum avatar

kaafum

New Zenner

Join Date:
Oct 2009
Posts:
55
Plugin Contributions:
0

Re: How do i make banner ads appear on the front page only?

kuroi:

@kaafum

It looks as though the code you've posted is incomplete. I can see a php block comment terminator just after the condition you have added, suggesting that the home page restriction you have added is in the middle of code that is ignored. If that comment block is started earlier (rather than being superfluous) it would explain why your restriction isn't having any effect.

Hi Kuroi,

Many thanks for your reply, but it's not clear what I should do now to make this work. What information is missing here? Many thanks again for your kind reply.

18 Aug 2010, 7:46 PM
#50
kaafum avatar

kaafum

New Zenner

Join Date:
Oct 2009
Posts:
55
Plugin Contributions:
0

Re: How do i make banner ads appear on the front page only?

Hi guys, i am really stuck here. can anybody tell me what i should do? I am really not the average or above technical guy. please someone hear my voice ... :blush:

19 Aug 2010, 7:07 AM
#51
kaafum avatar

kaafum

New Zenner

Join Date:
Oct 2009
Posts:
55
Plugin Contributions:
0

Re: How do i make banner ads appear on the front page only?

Hi guys, still struggling to get this right. Is there anybody who knows why I am not able to get rid of the banner on other pages apart from the homepage? Any input is much appreciated please.

19 Aug 2010, 9:31 AM
#52
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: How do i make banner ads appear on the front page only?

Same answer as yesterday.

It looks as though you have inserted your restriction into the home page into an if statement that is commented out and so ignored. Look for "/" as the start of the comments and "/" as the end.

However, the snippet of code you posted only shows the closing symbol, so it's not possible to be 100% sure, though it is very likely, since the closing brackets "}" are also commented out.

However, I'm doubting that you will want to simply uncomment them as that would make display of your banner dependent on there being Zen Cart banners to display.

Instead you should move your restriction (the bit you highlighted in red) inside the commented area.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

19 Aug 2010, 11:14 AM
#53
kaafum avatar

kaafum

New Zenner

Join Date:
Oct 2009
Posts:
55
Plugin Contributions:
0

Re: How do i make banner ads appear on the front page only?

Hi, sorry this is getting annoying, but I tried what you said. Well, at least I think I tried... But I know for sure it doesn't work yet. I am really not the average expert in this field. Can you please tell me, where would you put this code and how? This is what I have right now...

*/
?>

<div id="navColumnOneWrapper" style="width: <?php echo BOX_WIDTH_LEFT; ?>"><?php require(DIR_WS_MODULES . zen_get_module_directory('column_left.php')); ?></div></td> <?php } ?> <td valign="top"> <!-- bof breadcrumb --> <?php if (DEFINE_BREADCRUMB_STATUS == '1' || (DEFINE_BREADCRUMB_STATUS == '2' && !$this_is_home_page) ) { ?> <div id="navBreadCrumb"><?php echo $breadcrumb->trail(BREAD_CRUMBS_SEPARATOR); ?></div> <?php } ?> <!-- eof breadcrumb --> <!-- bof center column contents --> <div id="centerColumnContentWrapper"> <!-- commented out for real banner --> <?php /* <?php if (SHOW_BANNERS_GROUP_SET3 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3)) { if ($banner->RecordCount() > 0) { ?> <div id="bannerThree" class="banners"><?php echo zen_display_banner('static', $banner); ?></div> */?> <div id="imgcontainer"> <img src=http://www.hollandalarm.nl/includes/templates/custom091/images/overzicht.jpg title="Overzicht" rel=http://www.hollandalarm.nl> <img src=http://www.hollandalarm.nl/includes/templates/custom091/images/Semplice.jpg title="Semplice" rel=http://www.hollandalarm.nl/alarmsysteem-huis/draadloos-alarmsysteem-semplice-p-180/> <img src=http://www.hollandalarm.nl/includes/templates/custom091/images/Avanzato.jpg title="Avanzato" rel=http://www.hollandalarm.nl/alarmsysteem-huis/draadloos-alarmsysteem-avanzato-p-181/> <img src=http://www.hollandalarm.nl/includes/templates/custom091/images/Professionale.jpg title="Professionale" rel=http://www.hollandalarm.nl/alarmsysteem-huis/draadloos-alarmsysteem-professionale-p-187/> </div> <div id="showCarousel"></div> <?php /* } } */?> <!-- bof upload alerts --> <?php if ($messageStack->size('upload') > 0) echo $messageStack->output('upload'); ?> <!-- eof upload alerts --> <?php /** * prepares and displays center column * */
19 Aug 2010, 3:02 PM
#54
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: How do i make banner ads appear on the front page only?

As kuroi has pointed out, you have commented out code that is commenting out a bit too much of the code ...

You appear to want all the links commented out so I have done that with HTML comments ...

If you want those back in, you can remove the commented makers that are in red:

<?php
  if ($this_is_home_page && SHOW_BANNERS_GROUP_SET3 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3)) {
    if ($banner->RecordCount() > 0) {
?>
<div id="bannerThree" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>

<!-- turned off
<div id="imgcontainer">
<img src=http://www.hollandalarm.nl/includes/templates/custom091/images/overzicht.jpg title="Overzicht" rel=http://www.hollandalarm.nl>
<img src=http://www.hollandalarm.nl/includes/templates/custom091/images/Semplice.jpg title="Semplice" rel=http://www.hollandalarm.nl/alarmsysteem-huis/draadloos-alarmsysteem-semplice-p-180/>
<img src=http://www.hollandalarm.nl/includes/templates/custom091/images/Avanzato.jpg title="Avanzato" rel=http://www.hollandalarm.nl/alarmsysteem-huis/draadloos-alarmsysteem-avanzato-p-181/>
<img src=http://www.hollandalarm.nl/includes/templates/custom091/images/Professionale.jpg title="Professionale" rel=http://www.hollandalarm.nl/alarmsysteem-huis/draadloos-alarmsysteem-professionale-p-187/>
</div>

<div id="showCarousel"></div>
-->

<?php
    }
  }
?>

NOTE: I placed the code for the:
$this_is_home_page

at the start of the IF rather than in the middle of the IF ...

See if this works better for you ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

19 Aug 2010, 3:14 PM
#55
kaafum avatar

kaafum

New Zenner

Join Date:
Oct 2009
Posts:
55
Plugin Contributions:
0

Re: How do i make banner ads appear on the front page only?

Hi Linda,

I did exactly what you said, but now I lost the banner on all pages. I only need it on my homepage. Somehow it is not reacting to that if command we put in. Any other suggestion? I am about to lose it and just to show you how I feel: :frusty:

So please any winning thoughts?

19 Aug 2010, 5:35 PM
#56
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: How do i make banner ads appear on the front page only?

In the original code, you would have:

<!-- eof breadcrumb -->

<?php
  if (SHOW_BANNERS_GROUP_SET3 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3)) {
    if ($banner->RecordCount() > 0) {
?>
<div id="bannerThree" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
<?php
    }
  }
?>

<!-- bof upload alerts -->

Notice the two lines that I highlighted in red ...

What do you have currently in your tpl_main_page.php from the first line in red to the last line in red ... :unsure:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

19 Aug 2010, 6:07 PM
#57
kaafum avatar

kaafum

New Zenner

Join Date:
Oct 2009
Posts:
55
Plugin Contributions:
0

Re: How do i make banner ads appear on the front page only?

Hi,

This is what I have....

<?php if ($this_is_home_page && SHOW_BANNERS_GROUP_SET3 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3)) { if ($banner->RecordCount() > 0) { ?> <div id="bannerThree" class="banners"><?php echo zen_display_banner('static', $banner); ?></div> */?>
19 Aug 2010, 6:28 PM
#58
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: How do i make banner ads appear on the front page only?

You're mixing up two things here.

You're right to want to suppress the Zen Cart banners completely. But want to allow your own banner through for the homepage only.

Try this

<?php /* if (SHOW_BANNERS_GROUP_SET3 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3)) { if ($banner->RecordCount() > 0) { ?> <div id="bannerThree" class="banners"><?php echo zen_display_banner('static', $banner); ?></div> <?php */ ?> <?php if ($this_is_home_page) { ?> <div id="imgcontainer"> <img src=http://www.hollandalarm.nl/includes/templates/custom091/images/overzicht.jpg title="Overzicht" rel=http://www.hollandalarm.nl> <img src=http://www.hollandalarm.nl/includes/templates/custom091/images/Semplice.jpg title="Semplice" rel=http://www.hollandalarm.nl/alarmsysteem-huis/draadloos-alarmsysteem-semplice-p-180/> <img src=http://www.hollandalarm.nl/includes/templates/custom091/images/Avanzato.jpg title="Avanzato" rel=http://www.hollandalarm.nl/alarmsysteem-huis/draadloos-alarmsysteem-avanzato-p-181/> <img src=http://www.hollandalarm.nl/includes/templates/custom091/images/Professionale.jpg title="Professionale" rel=http://www.hollandalarm.nl/alarmsysteem-huis/draadloos-alarmsysteem-professionale-p-187/> </div> <div id="showCarousel"></div> <?php /* } */ } ?>

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

19 Aug 2010, 6:43 PM
#59
kaafum avatar

kaafum

New Zenner

Join Date:
Oct 2009
Posts:
55
Plugin Contributions:
0

Re: How do i make banner ads appear on the front page only?

YESSSSSSSSSSSSSSSSS

:clap::clap::clap::clap::clap:

Thank you thank you thank you.....

28 Sep 2010, 2:58 PM
#60
micmed avatar

micmed

Zen Follower

Join Date:
Mar 2008
Location:
The Free South
Posts:
165
Plugin Contributions:
0

Re: How do i make banner ads appear on the front page only?

kuroi, Post #19 worked perfectly for me. Thanks

www.theCableStation.com
"If we restrict liberty to attain security we will lose them both."