Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / tpl_main_page.php for my home page...

tpl_main_page.php for my home page...

Views: 438

Results 1 to 3 of 3
2 Dec 2012, 8:57 PM
#1
swamyg1 avatar

swamyg1

Zen Follower

Join Date:
Dec 2008
Location:
San Fran
Posts:
382
Plugin Contributions:
0

tpl_main_page.php for my home page...

I'm trying to get a different structure for my index page, so I've followed the instructions and created an /index folder inside my template directory, and placed a modified tpl_main_page.php inside that directory.

Problem is the changes I'm making to that file seem to be site wide. Am I doing something wrong?

2 Dec 2012, 9:59 PM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: tpl_main_page.php for my home page...

The structure of Zen Cart page names has the homepage living with the category and product listing pages under the umbrella of "index". There is no way I know of to separate the three different pages with "page-specific" foldernames. The stylesheet handling has a provision to treat the homepage separately with index_home.css; it would be a great leap in customizability to have something of the like for the page name folders. I doubt that could reasonably happen until v2.0, but the recoding involved there might be able to allow the distinction...

Meanwhile, you can use
if($this_is_homepage){ your code }
for alternate handling sections in files.

3 Dec 2012, 12:35 AM
#3
swamyg1 avatar

swamyg1

Zen Follower

Join Date:
Dec 2008
Location:
San Fran
Posts:
382
Plugin Contributions:
0

Re: tpl_main_page.php for my home page...

Ahhhh, yes. Completelyu forgot about that one. Thanks Glenn, worked like a charm.