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:
Views: 28,387
New Zenner
ok, got it. i didnt notice the answer from above :laugh:
New Zenner
Post #19 in this thread appears to be working perfectly...thanks!
New Zenner
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 -->Totally Zenned
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
Zen Follower
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
New Zenner
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
New Zenner
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 /* } } */?>Totally Zenned
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)
New Zenner
kuroi:
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.
New Zenner
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:
New Zenner
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.
Totally Zenned
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)
New Zenner
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...
*/
?>
Oba-san
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 ...
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!
New Zenner
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?
Oba-san
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 ...
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!
New Zenner
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> */?>Totally Zenned
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)
New Zenner
YESSSSSSSSSSSSSSSSS
:clap::clap::clap::clap::clap:
Thank you thank you thank you.....
Zen Follower
kuroi, Post #19 worked perfectly for me. Thanks
www.theCableStation.com
"If we restrict liberty to attain security we will lose them both."
Tell staff why this post should be reviewed.