Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / override default templates

override default templates

Locked

Views: 979

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
5 Aug 2007, 11:02 PM
#1
cbrillow avatar

cbrillow

New Zenner

Join Date:
Aug 2007
Posts:
3
Plugin Contributions:
0

override default templates

Hello,

Just installed zencart and am trying to take some first steps at customization. I just wanted to do something simple, like changing the "Congratulations! you have successfully installed..." message and I read the FAQ on that subject, as well as a tutorial that said essentially the same thing.

Per the instructions, I copied the index.php file from the includes/languages/english directory to my local system and made some text changes to the specified lines. I then created a new directory, includes/languages/english/custom_1, uploaded the changed file (in ascii mode) to it and made sure that the permissions were at 755.

But zencart will not read the file in my custom_1 directory. It reads the file in includes/languages/english/. If I copy my file to includes/languages/english/classic, it will be read from there. There's obviously something I'm misinterpreting about the FAQ answer, because several other questions are worded similarly, and I can't get them to work either.

I'd appreciate someone pointing me in the right direction!

Thanks,
Chuck

Read the FAQ

5 Aug 2007, 11:43 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: override default templates

This function is template specific - i.e. in a folder with the same name as your active template. So as this works with the "classic" templater and location I suspect that if you look in the admin > tools > template Selection > that "Classic" is set as the default.

Breifly: if you copy the template files in includes/templates/classic > to a new folder under templates with a name for your template(can be any name you like) and edit the template_info.php file to reflect this - then this name should be a selection in the admin.

From there - you can create a folder at any level where there exists a classic folder and override the files at that level by placing your edited copy in this folder.

Mulitple folders named for your template and any where you see a classic folder.

Hope this helps

6 Aug 2007, 12:17 PM
#4
cbrillow avatar

cbrillow

New Zenner

Join Date:
Aug 2007
Posts:
3
Plugin Contributions:
0

Re: override default templates

Thank you both for your prompt and helpful replies. I've waded through a lot of information trying to figure this out for myself, but something just didn't click. Hopefully, the information you've provided will be all I need.

Cheers,
Chuck

6 Aug 2007, 12:55 PM
#5
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: override default templates

To create a very basic custom template (you can build from there), you need:

  • includes/languages/YOUR_TEMPLATE/english.php
  • includes/languages/english/YOUR_TEMPLATE/index.php
  • includes/languages/english/YOUR_TEMPLATE/header.php (to change the logo)
  • includes/templates/YOUR_TEMPLATE/template_info.php
  • includes/templates/YOUR_TEMPLATE/common/tpl_header.php
  • includes/templates/YOUR_TEMPLATE/common/tpl_footer.php
  • includes/templates/YOUR_TEMPLATE/images/logo.gif
  • includes/templates/YOUR_TEMPLATE/css/stylesheet.css

Anywhere you see a /classic/ folder, you can create a folder for your custom template. You can copy the necessary files from either the /classic/ folder, the /template_default/ folder or the parent folder.

Edit includes/templates/YOUR_TEMPLATE/template_info.php to give your template identifying information so you'll recognize it in the admin under tools->template selection.

6 Aug 2007, 4:17 PM
#6
cbrillow avatar

cbrillow

New Zenner

Join Date:
Aug 2007
Posts:
3
Plugin Contributions:
0

Re: override default templates

More great information! Thanks very much.

6 Aug 2007, 7:29 PM
#7
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: override default templates

I did a prototype cart for a friend and decided to keep track of the things I changed to create the template. I thought it might come in handy in future. Creating a custom template seems overwhelming, but once you get the hang of it, it's pretty simple.