Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Unique Footer for Index

Unique Footer for Index

Locked

Views: 1,119

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
13 Aug 2009, 1:31 PM
#1
button_up avatar

button_up

New Zenner

Join Date:
Aug 2009
Location:
South Portland, ME
Posts:
2
Plugin Contributions:
0

Unique Footer for Index

Thanks in advance -

I'm relatively new to Zen Cart, and can't find a thread that answers my question.

I'm trying to create a unique footer for the index page of a site I'm working on. Unfortunately, the template for the site was customized by a third-party developer, so I'm finding that a good bit of the admin has been changed. I am, however, comfortable with php and html if the answer can be found in the file structure.

Any advice or help would be greatly appreciated.

13 Aug 2009, 3:27 PM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: Unique Footer for Index

The template has nothing to do with the admin, so this developer must really have messed with it a lot. If they have significantly changed even the admin, the template file structure may be unrecognizable to us.
A link to see your site may let us guess how much the template structure has been changed.

There is a built-in system for using custom copies of template files on specific page names, but "index" will catch both the home page and listing pages. You will (probably) need to add some code to the top of /includes/templates/your_template/common/tpl_footer.php.```php
if ($this_is_home_page){
//use your custom footer code here
}else{
//wrap this around all of the standard footer code

}

13 Aug 2009, 5:41 PM
#3
button_up avatar

button_up

New Zenner

Join Date:
Aug 2009
Location:
South Portland, ME
Posts:
2
Plugin Contributions:
0

Re: Unique Footer for Index

Glenn,

Thanks for the response. I tried adding your code to the tpl_footer.php file, but it didn't work.

Actually, no edits to that file show up on the site, and rather, it seems that the footer code is found in the tpl_main_page.php file. Thus, I tried the same code in this file, but for some reason, only the else condition is met and the standard site-wide footer is shown.

Do I need to define the $this_is_home_page variable, and if so, where should I do that?

Here's the site if you think it might help:
http://www.alpineh2o.com

Thanks again

15 Aug 2009, 7:05 PM
#4
totalsam avatar

totalsam

Zen Follower

Join Date:
Jan 2009
Posts:
126
Plugin Contributions:
0

Re: Unique Footer for Index

Hello,

Just bumping this as I would like to remove the header and footer from a selection of pages and don't know how. What exactly needs to go into the if($xxxxxxxx) bit?

17 Aug 2009, 4:53 PM
#5
gjh42 avatar

gjh42

Black Belt

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

Re: Unique Footer for Index

totalsam - For your question, you would edit
/includes/templates/your_template/common/tpl_main_page.php. The comments at the top of that file describe how to disable header, footer, etc. for any given page(s).

button-up - You have a very old version of Zen Cart:
// $Id: stylesheet.css 1223 2005-04-22 03:46:20Z ajeh $
This would probably be version 1.2.4 or 5. It is completely table-based layout (harder to customize), and lacks many security features (probably four years' worth of them). It also doesn't have the $this_is_home_page variable, so that will do nothing for you in this case.

You really need to upgrade this site to v1.3.8a, which will require rebuilding the template, for the safety of the site.

18 Aug 2009, 10:42 AM
#6
totalsam avatar

totalsam

Zen Follower

Join Date:
Jan 2009
Posts:
126
Plugin Contributions:
0

Re: Unique Footer for Index

Hello,
This works fine with any page that runs via the index.php but mine doesn't its an additional mod that uses a different page name completely and this method does not work for this.
Any ideas?

18 Aug 2009, 12:04 PM
#7
gjh42 avatar

gjh42

Black Belt

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

Re: Unique Footer for Index

If your mod has a pagename (shows in the address bar at the top of your screen as main_page=pagename), you can use that pagename in the test:```php
if (in_array($current_page_base, explode(',', 'pagename')){
$flag_disable_footer = true;
}

19 Aug 2009, 2:18 PM
#9
gjh42 avatar

gjh42

Black Belt

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

Re: Unique Footer for Index

So your mod page is completely outside the ZC structure... that makes it trickier. It would help to see this live in order to better understand the situation. You may need page-specific styling to hide the sidebars rather than completely disabling them.