Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Override system seems complicated

Override system seems complicated

Locked

Views: 5,800

Results 1 to 20 of 23
This thread is locked. New replies are disabled.
3 Nov 2006, 6:49 AM
#1
syntax2 avatar

syntax2

New Zenner

Join Date:
Nov 2006
Posts:
2
Plugin Contributions:
0

Override system seems complicated

Not only do my changes not appear, but the instructions on how to use this override system on here are very poor. Broken english, none of them have a complete explaination of what to do.. some say to change this, some say change that.. none say you have to change all the folders and create a template, but then theres a thread that mentions creating a template file..

And then on top of it all.. I never recieved my email to activate my account so I had to sign up a second time.. I waited an hour and it never came.. and wasted that hour waiting, battling this overide system which I still dont have working..

Ive created a folder called custom.. all over the freakin place..
and put one in the templates folder, and in the admin panel.. which Ive seen no instructions on how to use.. I attempted to change to my template which did appear, but then the only part of the page that displayed was the header.php file I put in my custom folder.. the rest of the page is blank..

So now Im clueless and rather frustrated.. Im ready to say the hell with updates, I'll just edit the master files, because this is crap..

3 Nov 2006, 7:33 AM
#2
syntax2 avatar

syntax2

New Zenner

Join Date:
Nov 2006
Posts:
2
Plugin Contributions:
0

Re: Override system seems complicated

Well it would be nice if someone pointed out that when you create your own template all the boxes/banners/search/cart modules that are on the left and right of the page get disabled by default..

At least mine did.. all this time Ive wasted to find out that the page was blank because all the modules were turned off..

3 Nov 2006, 7:36 AM
#3
samad64 avatar

samad64

Totally Zenned

Join Date:
May 2006
Location:
Texas
Posts:
554
Plugin Contributions:
2

Re: Override system seems complicated

it gets easier.. trust me. wherever you see a "classic" folder.. you can create your own folder.

for templating.. lets say you want to change a file like tpl_product_display (product display template). Copy it in the same structure into your custom folder. For example, that file is in the includes/templates/template_default/templates folder. When putting it in your custom folder.. here's how it should go:

includes/templates/CUSTOM/templates/tpl_product_display.php

Simple as that. There are no overrides in the admin panel at this time.

To enable your newly created files.. you need to change the template in your admin panel. Admin > Tools > Template Selection.. and click edit and choose your template (if it shows up. if it doesn't, copy over the template_info.php file and edit the stuff inside of it to match what you want it to say.. then try again)

3 Nov 2006, 12:12 PM
#4
ryk avatar

ryk

Totally Zenned

Join Date:
Oct 2004
Location:
Southport, UK
Posts:
3,644
Plugin Contributions:
6

Re: Override system seems complicated

Syntax2:

Well it would be nice if someone pointed out

You didn't actually ask a question...you came on here with a first post that's bit of a rant, and from your comments, I'm guessing that you leapt straight in. You certainly haven't read the tutorials/FAQ section as if you had, you'd have found the one labelled How do I create a new Custom Template? which tells you EXACTLY what you need to do to create your own custom template folders.

ZenCart is downloaded hundreds of times a day; there a thousands upon thousands of ZC stores around the web. Almost any question you can think of will have been asked - and answered - somewhere within these forums...so search, then ask if you still can't find what you're looking for.

You'll find this an amazingly helpful community - but don't just moan.

3 Nov 2006, 1:50 PM
#5
styledata avatar

styledata

Zen Follower

Join Date:
Feb 2006
Posts:
290
Plugin Contributions:
0

Re: Override system seems complicated

The override system does seem to be one of the most misunderstood features of Zencart. And one of the biggest topics on the forum. I have wondered why the folder system for overrides is not simply built into the release, as empty folders, under the name CUSTOM. A short text file in each folder could explain what you could put in there.
Failing that, it would be great if someone came out with a contribution that created all the folders for a custom template for you, in the proper structure, that you could upload to your site, with a text or html file explaining what to do.
I may be naive in the world of coding, but this seems to me to be one of those things that could be easily rectified by one of the two approaches.

3 Nov 2006, 1:58 PM
#6
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: Override system seems complicated

I have wondered why the folder system for overrides is not simply built into the release, as empty folders, under the name CUSTOM. A short text file in each folder could explain what you could put in there.

Hi Style,
while this sounds like a good idea, it would then have the same issue as using the classic folder.
it would be over written the next time you upgraded.

the other sounds feasible and I might just do that later this afternoon.

3 Nov 2006, 2:01 PM
#7
ryk avatar

ryk

Totally Zenned

Join Date:
Oct 2004
Location:
Southport, UK
Posts:
3,644
Plugin Contributions:
6

Re: Override system seems complicated

The instruction "wherever you see a **classic **folder, you can place your own custom one alongside it" doesn't really leave much room to screw up! :D

3 Nov 2006, 2:06 PM
#8
ajeh avatar

ajeh

Oba-san

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

Re: Override system seems complicated

I am sorry that you had difficulty in reading all of the FAQs and Wiki for getting started in addition to trouble using the search ...

The templates and overrides directories are all marked, as indicated before, by the /classic directory to help as a guide to lead you to where and what can be overridden ...

The template structure itself is based on /includes/templates/template_default

But you will note that the only things in the /includes/templates/classic are the bare essentials ...

You never copy a file to a templates and overrides directory unless you are actually making changes ...

Languages follow the same pattern in the /includes/languages

At various levels you will again see the /classic directory ... this means that is where overrides for that given directory would belong ...

The same holds true on the code side of the directory structure such as:
/includes/modules with overrides indicated to go to the /includes/modules/your_template_dir because again you will see the /classic directory ...

There are no overrides for functions and classes, but you will see the /includes/functions/extra_functions directory ... this is a location of where you can add your own functions and they will autoload for you as if part of /includes/functions files ...

Again, not as overrides but as additional or extra functions that you may need ...

Similarly you will see in the /includes directory
/includes/extra_configures
/includes/extra_datafiles

These are made for adding on to things like new database define and new filename defines without having to touch the original files ...

You can use 1 or many files in the /extra_something directories so that add-ons, your own code, etc. is more easily managed ...

I do hope you will take advantage of the forum, FAQs and Wiki to help make your Zen Cart experience more meaningful ...

3 Nov 2006, 2:59 PM
#9
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: Override system seems complicated

Here go,
its quick and its easy but its the entire template file structure
with a read me for each folder explaining what needs to go where

Custom template base file structure

3 Nov 2006, 3:23 PM
#10
styledata avatar

styledata

Zen Follower

Join Date:
Feb 2006
Posts:
290
Plugin Contributions:
0

Re: Override system seems complicated

Merlinpa1969:

Here go,
its quick and its easy but its the entire template file structure
with a read me for each folder explaining what needs to go where

Custom template base file structure

Wow that's fast service! Looks great. I hope it saves YOU folks some time in answering questions, so you can keep working on the magic for us.

3 Nov 2006, 4:15 PM
#11
clydejones avatar

clydejones

Deceased

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

Re: Override system seems complicated

Merlinpa1969:

Here go,
its quick and its easy but its the entire template file structure
with a read me for each folder explaining what needs to go where

Custom template base file structure

Merlin,

You might want to point out in your Overview and How To that although the folders are named "custom" they can be renamed to anything the user wants.

If you don't mind, I think I'll reference the download in a couple of tutorial/FAQ articles as well as in the wiki.

3 Nov 2006, 5:09 PM
#12
ryk avatar

ryk

Totally Zenned

Join Date:
Oct 2004
Location:
Southport, UK
Posts:
3,644
Plugin Contributions:
6

Re: Override system seems complicated

clydejones:

You might want to point out in your Overview and How To that although the folders are named "custom" they can be renamed to anything the user wants.

And you must spell it out that they must all be the same! :D

Because if you don't , someone will come along and say "Well it would be nice if someone pointed out that when you..." :laugh:

(Oh, and could we have a set called YOUR_TEMPLATE please)

3 Nov 2006, 5:51 PM
#13
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,616
Plugin Contributions:
0

Re: Override system seems complicated

Thank for the overrides set up example Merlin.

PLEASE NOTE you do not have to add a directory if you are not going to use it. A template can be built with as few as 2 files, the template_info and a stylesheet.

3 Nov 2006, 9:56 PM
#14
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: Override system seems complicated

Thanx, I should have pointed that out Kim

And clyde, I thought about adding it in the instructions that they could rename em however I thought that changing the tpl info page might confuse to many folks,

to many moving parts

3 Nov 2006, 10:08 PM
#15
waveneybooks avatar

waveneybooks

New Zenner

Join Date:
Sep 2006
Location:
Suffolk, UK
Posts:
64
Plugin Contributions:
0

Re: Override system seems complicated

Thanks Merlin.:yes:

18 Jan 2007, 1:56 AM
#16
cmcgaugh avatar

cmcgaugh

New Zenner

Join Date:
Dec 2006
Location:
Escondido, California
Posts:
38
Plugin Contributions:
0

Re: Override system seems complicated

I downloaded Merlin's Template Base (thanks, Merlin!), put it in
includes/templates/ and renamed it "Custom".

I understand also that I can put a "custom" folder in any folder
with a "classic" folder.

What I don't get is if I put edited .php files in the custom folders,
how does php find the right files, i.e. the overrides?

Why is the folder system in the Template Base folder different than
the template_default folder?

When creating a custom template, why not simply take the template_default,
rename it to whatever, and customize it instead instead of creating an empty
folder, putting an images folder in it, etc? :huh:

Thanks!
Cal

18 Jan 2007, 2:06 AM
#17
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: Override system seems complicated

Zen Cart is programed to look in the Custom template ( as defined by the database ) folders first, then if it dosnt find the file its looking for it goes and gets the default file

When creating a custom template, why not simply take the template_default,
rename it to whatever, and customize it instead instead of creating an empty
folder, putting an images folder in it, etc?

this is because you wont possibly change every file in the system,
by only placing the files that you have changed into over rides, it makes it easier to upgrade and keeps things more orginized.

18 Jan 2007, 7:40 PM
#18
cmcgaugh avatar

cmcgaugh

New Zenner

Join Date:
Dec 2006
Location:
Escondido, California
Posts:
38
Plugin Contributions:
0

Re: Override system seems complicated

Merlinpa1969:

Zen Cart is programed to look in the Custom template ( as defined by the database ) folders first, then if it dosnt find the file its looking for it goes and gets the default file ....

If you can name the folder whatever you want, eg "custom", how
does the db know what you called it?

I see you can pick which template to use in the Admin, but what about the "custom" folders
in the other parts of Zen Cart that have a "classic" folder and a
"custom" (if present)? How does putting edited .php files in the custom
(or whatever you name it) folder override the classic files?

Don't you have to specify somewhere in Admin or in one of the core files,
where the override folders are located?

Also, I really appreciate the Template Base files you set up with
txt explanations, but just wondered why it isn't structured the same
as template_default?

I think Ajeh's post #8 in this thread is trying to explain the system, but
just don't see how you can name the overrides folders whatever you want
and Zen will find them.

Cal

18 Jan 2007, 7:58 PM
#19
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: Override system seems complicated

It is structured the same as template default......

The simplest way to explain this is....

you tell the system what template to look for n the admin-> tools-> template selector

the system then looks for all folders that match that template, ( the folder names are defined in the template-info file )

classic is an example of how to use the over rides.

18 Jan 2007, 9:49 PM
#20
cmcgaugh avatar

cmcgaugh

New Zenner

Join Date:
Dec 2006
Location:
Escondido, California
Posts:
38
Plugin Contributions:
0

Re: Override system seems complicated

Merlinpa1969:

It is structured the same as template default......

The simplest way to explain this is....

you tell the system what template to look for n the admin-> tools-> template selector

the system then looks for all folders that match that template, ( the folder names are defined in the template-info file )

classic is an example of how to use the over rides.

I get it!
Thanks, Merlin.....that was the piece of the puzzle I needed.

:thumbsup: