Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Everything that should be done for the override system

Everything that should be done for the override system

Locked

Views: 3,490

Results 1 to 11 of 11
This thread is locked. New replies are disabled.
2 Jul 2006, 4:24 AM
#1
godspeed27 avatar

godspeed27

Zen Follower

Join Date:
May 2006
Location:
Japan
Posts:
322
Plugin Contributions:
1

Everything that should be done for the override system

Ok, so I have been using zen cart for a while now, well everyday for almost 2 months. I kind of just figured out that I am not using the override system at all. So can I ask, what should be included in this? Is it just part of the template or is there more to this. Should be simple to change, if it’s just the template.

2 Jul 2006, 4:54 AM
#3
godspeed27 avatar

godspeed27

Zen Follower

Join Date:
May 2006
Location:
Japan
Posts:
322
Plugin Contributions:
1

Re: Everything that should be done for the override system

so it is just the template

2 Jul 2006, 4:58 AM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Everything that should be done for the override system

There are template overrides, language overrides, module overrides, etc. etc. etc.

Take your time in reading through the WIKI and FAQs and /docs about the templates and overrides ...

2 Jul 2006, 5:02 AM
#5
godspeed27 avatar

godspeed27

Zen Follower

Join Date:
May 2006
Location:
Japan
Posts:
322
Plugin Contributions:
1

Re: Everything that should be done for the override system

in the wiki and also in the faq, I can't find anything with a topic of override system, I can do a search but that gives me way more than I know what to do with. I was just trying to get a list of things, to make a checklist to go through.

2 Jul 2006, 5:13 AM
#6
clydejones avatar

clydejones

Deceased

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

Re: Everything that should be done for the override system

The links I gave you are for the template and override systems.

2 Jul 2006, 5:20 AM
#7
mlm2005 avatar

mlm2005

Zen Follower

Join Date:
Mar 2005
Posts:
141
Plugin Contributions:
0

Re: Everything that should be done for the override system

The way I understand this is that everything as it is now is being “called from” the template_default folder UNLESS there is a file with the same name in your CUSTOM TEMPLATE FOLDER. Then this particular file would be called and used. So, keep everything as it is in the template_default folder and only save “changed information” in the CUSTOM template folder. And, make sure if you modify a file located in a sub-folder of “template_default” that you make sure there is a corresponding folder set up in the Custom template as well.

There is no need to copy the entire template_default contents to your Custom template folder. Only changed files.

The question I would be asking yourself is what files did you modify and where was the location of the files? If you modified files in the Template Default files instead of COPIES of the files you might be okay with setting up the corresponding folders and copying the files you modified into them. Other people more experienced than I would have to let you know if an UNMODIFIED version of the files has to exist in the template_default folder.

This is just an explanation of the template overrides. There are other files that can be modified that you would have do treat similarly. For example, I had to recently modify my TPL_Header.PHP file. So I copied the original file into My Custom Template/Common/ folder and modified my copy, leaving the original untouched.

Hope that helps!

2 Jul 2006, 6:42 AM
#8
godspeed27 avatar

godspeed27

Zen Follower

Join Date:
May 2006
Location:
Japan
Posts:
322
Plugin Contributions:
1

Re: Everything that should be done for the override system

mlm2005:

The way I understand this is that everything as it is now is being “called from” the template_default folder UNLESS there is a file with the same name in your CUSTOM TEMPLATE FOLDER. Then this particular file would be called and used. So, keep everything as it is in the template_default folder and only save “changed information” in the CUSTOM template folder. And, make sure if you modify a file located in a sub-folder of “template_default” that you make sure there is a corresponding folder set up in the Custom template as well.

There is no need to copy the entire template_default contents to your Custom template folder. Only changed files.

The question I would be asking yourself is what files did you modify and where was the location of the files? If you modified files in the Template Default files instead of COPIES of the files you might be okay with setting up the corresponding folders and copying the files you modified into them. Other people more experienced than I would have to let you know if an UNMODIFIED version of the files has to exist in the template_default folder.

This is just an explanation of the template overrides. There are other files that can be modified that you would have do treat similarly. For example, I had to recently modify my TPL_Header.PHP file. So I copied the original file into My Custom Template/Common/ folder and modified my copy, leaving the original untouched.

Hope that helps!

Ok, thanks, I think I get it now.

2 Jul 2006, 9:03 AM
#9
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Everything that should be done for the override system

mlm2005:

The way I understand this is that everything as it is now is being “called from” the template_default folder UNLESS there is a file with the same name in your CUSTOM TEMPLATE FOLDER. Then this particular file would be called and used. So, keep everything as it is in the template_default folder and only save “changed information” in the CUSTOM template folder. And, make sure if you modify a file located in a sub-folder of “template_default” that you make sure there is a corresponding folder set up in the Custom template as well.

There is no need to copy the entire template_default contents to your Custom template folder. Only changed files.

The question I would be asking yourself is what files did you modify and where was the location of the files? If you modified files in the Template Default files instead of COPIES of the files you might be okay with setting up the corresponding folders and copying the files you modified into them. Other people more experienced than I would have to let you know if an UNMODIFIED version of the files has to exist in the template_default folder.

This is just an explanation of the template overrides. There are other files that can be modified that you would have do treat similarly. For example, I had to recently modify my TPL_Header.PHP file. So I copied the original file into My Custom Template/Common/ folder and modified my copy, leaving the original untouched.
This is a nice explanation. You note explicitly that you are referring to template overrides. It's worth re-iterating Ajeh's point earlier that there are also language and module overrides. Although most users will probably not use module overrides, pretty well every user should be using language overrides.

Language and module overrides operate in the same way as each other, and using the same priciple but a different file structure to template overrides. This often causes confusion.

Template overrides operate in parallel with template_default. By this I mean that (for example)

includes/templates/template_default/customer/tpl_header.php
can be overridden by
includes/templates/YOUR_TEMPLATE/customer/tpl_header.php
Language and module overrides however, operate hierarchically. For example to override
includes/languages/english/meta_tags.php
you would go to the files location and create a directory with the same name the directory in which your template_info file is located in templates and then place your override file in the new directory, i.e.
includes/languages/english/YOUR_TEMPLATE/meta_tags.php

2 Jul 2006, 9:36 AM
#10
mlm2005 avatar

mlm2005

Zen Follower

Join Date:
Mar 2005
Posts:
141
Plugin Contributions:
0

Re: Everything that should be done for the override system

Thank you Kuroi for explaining the rest of the override system. I'm still working on template overrides at this point but know that I'll have much to change using the language overrides. :)

2 Jul 2006, 9:44 AM
#11
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Everything that should be done for the override system

mlm2005:

I'm still working on template overrides at this point but know that I'll have much to change using the language overrides. :)It's very normal for the very first changes on any site to be to english.php and header.php. If you've made changes to these files, then you've already used the languages override system (or not! :smile:)