Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Confused about templates/customisation etc

Confused about templates/customisation etc

Locked

Views: 773

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
30 Sep 2009, 12:06 PM
#1
richard_rodriguez avatar

richard_rodriguez

New Zenner

Join Date:
Sep 2009
Posts:
26
Plugin Contributions:
0

Confused about templates/customisation etc

Right, I've been reading a few bits here and there about customising ZenCart.

Let's pick just a simple couple of examples to kick off.

  1. I want to add some code to the product pages that will embed a video player. Basically, this will look up a new table with the product ID and if there is an entry then it will embed the player.

  2. I want to change the colour scheme of the entire site.

Now, I'm getting confused because the articles I read tend to start by saying that you should always make a new folder in the languages folder and give it the new template name. And then they go ahead and tell me to change the file in the "english" folder. And sometimes they says the folder is "[CUSTOM]. I don't understand the correct approach. If I am supposed to copy any files I want to modify into a new folder named after my template, then how do I tell ZenCart to use this template?

Thanks

30 Sep 2009, 1:12 PM
#2
afo avatar

afo

Totally Zenned

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

Re: Confused about templates/customisation etc

You tell Zen Cart to use your custom template by selecting it from the pull down menu in admin>tools>template selection.

The terms CUSTOM and YOUR_TEMPLATE are simply generic ways to refer to a custom template (or the override system). You can replace those terms with whatever you like. Each custom template must have a template_info.php file (in includes/templates/YOUR_TEMPLATE/) to identify it in the pull down menu I mentioned earlier.

There are free templates available for Zen Cart. You can see them in action at http://(sorry, site offline)/ Using one of them may give you a jump start.

30 Sep 2009, 1:33 PM
#3
richard_rodriguez avatar

richard_rodriguez

New Zenner

Join Date:
Sep 2009
Posts:
26
Plugin Contributions:
0

Re: Confused about templates/customisation etc

Thanks.
That helps to make sense of things a bit more. It's actually what I figured was required, but the documentation isn't very clear to me.
I'll try this out tonight and post back if I'm still lost.

30 Sep 2009, 6:44 PM
#4
richard_rodriguez avatar

richard_rodriguez

New Zenner

Join Date:
Sep 2009
Posts:
26
Plugin Contributions:
0

Re: Confused about templates/customisation etc

OK, so I created a new folder in the /includes/template/ folder and then I can see this as an option in my Template Selection screen.

So, if I want to be changing the text on a page, or perhaps adding a line of extra PHP code (e.g. to retrieve video IDs from the DB) should I be using my template to do this? Effectively, my template will be a copy of the Classic one and then I'll simply apply my changes to my template only.

Or, is this done in some other way? I was of the impression that I could make a custom version of an individual page and that the templating system would use the default pages unless it found a custom one in the selected template folder.

30 Sep 2009, 6:51 PM
#5
gjh42 avatar

gjh42

Black Belt

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

Re: Confused about templates/customisation etc

Your impression is correct. You use your template folders for saving the custom/override version of any files you edit.

30 Sep 2009, 7:05 PM
#6
richard_rodriguez avatar

richard_rodriguez

New Zenner

Join Date:
Sep 2009
Posts:
26
Plugin Contributions:
0

Re: Confused about templates/customisation etc

OK, but when I made the simplest of templates it didn't work in that way. Let me explain, I made a new folder and placed into just the template_info file, which I modified some details inside.

Then I chose this as my template and checked my site. The result was completely different to the classic/default template. Should it not pick up the CSS etc. from the classic folder unless the file is within my custom template folder?

Here's a before and after shot.

Before

After

Hang on, am I getting confused between the Classic template and the Default template? Is my custom template based on the one in the "template_default" folder, whereas the Classic one is just one that is included with the ZenCart package?

30 Sep 2009, 7:13 PM
#7
gjh42 avatar

gjh42

Black Belt

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

Re: Confused about templates/customisation etc

The Classic template is an override set of files/folders; if you make a new template and don't copy the /classic/ files, the default files in /template_default/ will be used until you add your customizations. You will always want a copy of stylesheet.css, and you should put your store-customized versions of english.php and other language files in your template folders.

30 Sep 2009, 7:37 PM
#8
richard_rodriguez avatar

richard_rodriguez

New Zenner

Join Date:
Sep 2009
Posts:
26
Plugin Contributions:
0

Re: Confused about templates/customisation etc

OK, so I could start my new custom template by copying the pre-installed Classic? That makes sense.

What's this about putting my store-customized versions of english.php in my template folder? What does this file do and where would I put it within my template folder?

As a side note, I just followed instructions to install the Cold Steel template and this included uploading "cold_steel" folders into the templates, languages and modules folders (and the sidebox sub-folder).

I thought everything would go into the templates/my_custom_template folder.

30 Sep 2009, 8:02 PM
#9
gjh42 avatar

gjh42

Black Belt

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

Re: Confused about templates/customisation etc

The fundamental approach to creating the override system, plus the multi-language capability, caused the distributed template folder setup. It makes individual file editing/comparing simpler at the cost of a more diffuse umbrella.