Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Front page template question

Front page template question

Views: 666

Results 1 to 5 of 5
10 Sep 2011, 3:19 PM
#1
greenmktg avatar

greenmktg

New Zenner

Join Date:
Sep 2011
Posts:
3
Plugin Contributions:
0

Front page template question

I'm having a template converted from from static to Zen-Cart and the index page of the template has no Zen-cart elements. Is it possible to insert a new "homepage" into Zen-Cart or should this be a standalone page outside of the Zen-cart system with links to the ZC elements - of course I'd prefer the first option?

I'm not too familiar with Zen-cart, but an ZC expert's advice will be greatly appreciated and understood.

Thank you!

10 Sep 2011, 3:52 PM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: Front page template question

You can put the main/center column content into define_main_page.php (in Tools > Define Page Editor), but the rest of the index page will need to be split out and put into the appropriate files for the page part. We can give some more detailed advice if we can see your original homepage, preferably a live link so we can look at the code behind it and how it interacts with other pages. Is the index page radically different from interior pages?

10 Sep 2011, 4:34 PM
#3
gjh42 avatar

gjh42

Black Belt

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

Re: Front page template question

Okay, for the Template Monster homepage template you showed me, your best bet would be to turn off sideboxes and probably header for the homepage in /includes/templates/your_template/common/tpl_main_page.php (instructions in the comments in that file). Then put the content of the page HTML source code (starting with <div id="main-tail-bot">) in define_main_page.php. That template has a bunch of javascripts doing various things, and you would need to integrate those following Zen Cart methods to get them to work. There is info on using javascript in the wiki as well as the forum. The menu links would need to be coded to point to the desired locations, which is a simple matter. This template has an unnecessarily huge number of divs enclosing its elements as usual with TM, but not much other bad code.
You would want to put the styling that is relevant to this homepage into a file named index_home.css, saved in /includes/templates/your_template/css/.

10 Sep 2011, 5:02 PM
#4
greenmktg avatar

greenmktg

New Zenner

Join Date:
Sep 2011
Posts:
3
Plugin Contributions:
0

Re: Front page template question

Thank you very much for that helpful information. Now I have enough to know what will be involved in the conversion. I am worried about the javascript, is this a problem that tends to come up in these cases with ZC?

10 Sep 2011, 6:11 PM
#5
gjh42 avatar

gjh42

Black Belt

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

Re: Front page template question

Not exactly a "problem"... Zen Cart has methods for automatically handling javascript files, but they need to be named amd placed correctly. The usual "add the script to the head" that people hear elsewhere can work, but you would then need to manually update it every time you upgrade ZC, and it might not validate.