I want to display banner ads in Header position 3, but i only want to show them on the home page of my website. Is there a simple piece of html code i can insert into the banner ad to hide it on all other pages?
I want to display banner ads in Header position 3, but i only want to show them on the home page of my website. Is there a simple piece of html code i can insert into the banner ad to hide it on all other pages?
No. But if you mean banner set 2 in the header, then you can change thisto thisif (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) {if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2) && $this_is_home_page) {
Kuroi Web Design and Development | Twitter
(Questions answered in the forum only - so that any forum member can benefit - not by personal message)
Thanks for the reply, but it is definately Header position 3 that i want to show on the main page only - any thoughts?
Thanks in advance
Although described as header position 3 in Admin > Configuration > Layout Settings, banner group set3 is actually displayed in the center panel. You can make this for the home page only by making a similar change to that explained above in your tpl_main_page.php.
Kuroi Web Design and Development | Twitter
(Questions answered in the forum only - so that any forum member can benefit - not by personal message)
I will definately try this, but can you please advise exactly what i need to change to achieve hiding banner set 3 on the main page - i have copied the text below from the tpl_main_page.php file, forgive my lack of knowledge, i m still in the process of learning about all this stuff
Many Thanks in advance
// the following IF statement can be duplicated/modified as needed to set additional flags
if (in_array($current_page_base,explode(",",'list_pages_to_skip_all_right_sideboxes _on_here,separated_by_commas,and_no_spaces')) ) {
$flag_disable_right = true;
}
$header_template = 'tpl_header.php';
$footer_template = 'tpl_footer.php';
$left_column_file = 'column_left.php';
$right_column_file = 'column_right.php';
$body_id = ($this_is_main_page) ? 'indexHome' : str_replace('_', '', $_GET['main_page']);
?>
>
RecordCount() > 0) {
?>
get_template_dir('tpl_header.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header.php');?>
trail(BREAD_CRUMBS_SEPARATOR); ?>RecordCount() > 0) { ?> size('upload') > 0) echo $messageStack->output('upload'); ?> RecordCount() > 0) { ?>
get_template_dir('tpl_footer.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_footer.php');?>
In default Zen Cart you would find the line in your tpl_main_page.php that is identical to the line to which I referred in my original post, except for referring to SET3 instead of SET2 and make the change that I recommended.
However, this line is not amongst the sample that your posted from your tpl_main_page.php file. This could mean that you haven't posted it all (it does look rather sparse) or that you are using a template whose author has removed it. Are you displaying this banner now?
Kuroi Web Design and Development | Twitter
(Questions answered in the forum only - so that any forum member can benefit - not by personal message)
I don't have the banner that i want to display displaying right now, but i can make banners appear in the Header position 3, i agree that this looks sparse, it is possible that this file has been edited by the developers of the original template, as i have found many instances where this is the case.
can i add the text you refer to in your original reply?
or is it possible i have more than one file named tpl_main_page.php?
what file path should it be under?
If you can make banners appear, then the code must be there. We're getting into territory now, where it would be easier to help you if I could see your site. Do you have a link to it?
Kuroi Web Design and Development | Twitter
(Questions answered in the forum only - so that any forum member can benefit - not by personal message)
My mistake, for some reason my FTP program wasn't opening the file correctly, but i have resolved this and added the modifications as you suggested to the SET3 line, however i now have this error
Fatal error: Call to a member function on a non-object in /home/jane776/public_html/shop/includes/templates/template_default/common/tpl_main_page.php on line 102
Any ideas?
A couple of things here. You shouldn't be making changes to the template_default files. You should only change your over-ride copy of them. I recommend reading up on over-rides in the FAQ.
Then onto why this isn't working and you are getting an error ... it does seem that there is a problem with either your version of Zen Cart not being up to date, or your template not supporting all Zen Cart functions. This is not easy to establish without more information about both and ideally seeing your site as well.
Kuroi Web Design and Development | Twitter
(Questions answered in the forum only - so that any forum member can benefit - not by personal message)
Bookmarks