Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Double Main Content above header and navigation

Double Main Content above header and navigation

Views: 957

Results 1 to 2 of 2
6 Jun 2014, 1:02 PM
#1
urgentprog avatar

urgentprog

New Zenner

Join Date:
Jun 2011
Posts:
32
Plugin Contributions:
0

Double Main Content above header and navigation

I am in process of upgrading my zen cart install from 1.1 to 1.5.1. It's also in japanese. I was able to upgrade and have special characters display properly. I am almost finished rebuilding the template but I am stuck on one error.

The main content shows up twice, once where it should be, and another at the very top of the page. I created a workaround by using a counter in <theme>/templates/tpl_index_default.php and an if block so it will only show once. But it is also occurring on other pages like product category pages.

I did a grep to search for instances of $tpl_page_body, and only found it once in /includes/modules/pages/index/main_template_vars.php. Commenting it out caused me to loose both the wrong content on top of the page, and the right one.

9 Jun 2014, 9:00 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Double Main Content above header and navigation

  1. The most common error people make is in the /includes/modules/pages/ subdirectories. They often rename header_php.php to header_php1.php and main_template_vars.php to main_template_vars1.php. The problem with that is they are keeping the ".php" on the end, and Zen Cart is built to load ALL *.php files from certain folders.
    So, instead of renaming to header_phpxxxxxx.php for a backup, rename to header_phpxxxxx.bak (using .bak instead of .php)

  2. Do a fresh compare of all the files in /includes/template/your_template/common against /includes/templates/template_default/common and make sure that you don't have unnecessary code in your customized files.