Forums / Templates, Stylesheets, Page Layout / I want a custom template based on default - how?

I want a custom template based on default - how?

Locked

Views: 1,352

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
18 Oct 2006, 12:45 PM
#1
pcmt avatar

pcmt

New Zenner

Join Date:
Jun 2006
Location:
Manchester UK
Posts:
59
Plugin Contributions:
0

I want a custom template based on default - how?

I've read up the various tutorials and the wiki pages. I must be missing something.

I would like to develop a new template my_template with the default Classic Contemporary Green one as the starting point. I thought I'd followed all the instructions: created a my_template folder with all the same folders and files as the default, then uploaded it and selected it in TOOLS/Template Selection/Edit then reset the layout boxes etc.

I'm now seeing the site as a full-width design, with orange and pink rows in the left sidebar, etc. Since I've replicated all the template_default folders and files in my new template, shouldn't I be seeing the same as the default install?

Patrick

18 Oct 2006, 1:03 PM
#2
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: I want a custom template based on default - how?

If you want to use the styles from "classic, You'll need to copy the stylesheet.css from "classic" to your new custom template css directory.

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

18 Oct 2006, 1:17 PM
#3
pcmt avatar

pcmt

New Zenner

Join Date:
Jun 2006
Location:
Manchester UK
Posts:
59
Plugin Contributions:
0

Re: I want a custom template based on default - how?

Well, I've followed the tutorial in https://www.zen-cart.com/tutorials/index.php?article=142

It says "Since Version 1.3.+ Zen Cart™ has moved away from its old table based layout to a CSS based layout. You should base your own template on template_default and not Classic."

I notice that when I switch back to Contemporary Green, the css files in the document head are from the classic folder, not template_default. So what is template_default?

If I copy the stylesheet.css from classic and put it in my_template, do I need anything else in my_template? I must say, this is not very clear.

Patrick

18 Oct 2006, 1:26 PM
#4
pcmt avatar

pcmt

New Zenner

Join Date:
Jun 2006
Location:
Manchester UK
Posts:
59
Plugin Contributions:
0

Re: I want a custom template based on default - how?

Added: I've copied the folders and files from Classic into my_template, and as you said, I now see the site in Contemporary Green - so that's okay. Thanks for that.

Still not clear why there are so many folders and files in template_default, and what their purpose is.

Patrick

18 Oct 2006, 1:40 PM
#5
neunetllc_com avatar

neunetllc_com

Banned

Join Date:
Oct 2006
Location:
New Albany Ohio
Posts:
113
Plugin Contributions:
0

Re: I want a custom template based on default - how?

there's a lot they leave you to discover on your own if you're so willing (not many are willing to walk you through the 1000+ files and how they talk to each other (those are just the zc files, not to mention apache and...))...

but here's the gist of the template over ride system:

when you see a classic folder somewhere with some files beside it...

SOME_FOLDER/classic/
SOME_FOLDER/file1
SOME_FOLDER/file2
...
SOME_FOLDER/filex

the files in SOME_FOLDER, in this case file1, file2,...,filex, can be copied into SOME_FOLDER/YOUR_FOLDER/ where YOUR_FOLDER is the name of your template. zc will look there first for files it needs.

so if you copy /includes/templates/template_default/ >> /includes/templates/YOUR_FOLDER/ and tell zc to point to that folder instead of /classic/ it will do that, until you select another template.

if you copy /includes/templates/classic/ >> /includes/templates/YOUR_FOLDER/ (aka /includes/templates/YOUR_TEMPLATE) your template will look like the default template that initializes when zc is installed... fondly known as the 'classic'.

the template system, in a nutshell, is like a highway system with parallel lanes, each lane is an over ride. once you tell zen cart to get on the highway and take a specific lane (a template) it will do so until finds itself at an impasse and will crash if it doesn't find an alternative route (template default is like the shoulder lane). otherwise, it will keep merrily cruising along.

aside: i call one of my templates 'cherry_lane'

note: when zc gets repointed to a new template, it turns the sideboxes off, so go to tools >> layout boxes controller and click the reset button if you want to do so.

cheers! ^.^

18 Oct 2006, 1:57 PM
#6
pcmt avatar

pcmt

New Zenner

Join Date:
Jun 2006
Location:
Manchester UK
Posts:
59
Plugin Contributions:
0

Re: I want a custom template based on default - how?

neunetllc.com, thanks for the info. I have copied the classic folders and files into my_template, and I'm seeing the Contemporary Green styles as required.

I'm hoping to keep the whole thing pretty simple and just tweak this theme a little. The over-ride concept is no doubt very clever, but as shallow a learning curve as possible is for me, I think.

Thanks again.

Patrick

18 Oct 2006, 2:39 PM
#7
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: I want a custom template based on default - how?

Here's a quick (annotated) look at "template_default" and the folders.

template_default

buttons /* contains the button images used by Zen Cart /
common /
contains template files common each page of your shop /
css /
contains the stylesheet(s) used by your shop /
images /
contains the images used by your shop /
jscript /
contains java script files used by your shop /
popup_??? /
these folders contain popup help files /
sideboxes /
contains template files used for the sideboxes in your shop /
templates /
contains the template files used to render the pages of your shop */

If Zen Cart can't find a file in your /CUSTOM template, it will look in template_default for the needed file.

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

18 Oct 2006, 3:04 PM
#8
pcmt avatar

pcmt

New Zenner

Join Date:
Jun 2006
Location:
Manchester UK
Posts:
59
Plugin Contributions:
0

Re: I want a custom template based on default - how?

clydejones:

If Zen Cart can't find a file in your /CUSTOM template, it will look in template_default for the needed file.

Okay, I see now. That's the over-ride system. The custom template over-rides the default but only for the files it contains. And the default is not the Classic theme.

Well, thanks again for taking the time to explain.

Patrick

18 Oct 2006, 3:49 PM
#9
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: I want a custom template based on default - how?

Okay, I see now. That's the over-ride system. The custom template over-rides the default but only for the files it contains. And the default is not the Classic theme.

"classic" is just like any other custom template.

By default, this is the template Zen Cart uses on new installs.

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.