Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / correct directory structure for overrides?

correct directory structure for overrides?

Locked

Views: 1,700

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
19 May 2008, 10:08 PM
#1
mzimmers avatar

mzimmers

Zen Follower

Join Date:
May 2008
Posts:
453
Plugin Contributions:
0

correct directory structure for overrides?

Hi -

In article https://www.zen-cart.com/tutorials/index.php?article=127 it says:

"Save the edited file to includes/languages/english/custom/header.php and upload it to your server."

But in article https://www.zen-cart.com/tutorials/index.php?article=36 it says:

"Then, you can make any needed modifications in your new:

/includes/languages/custom/english.php"

So...I'm a little confused. Does the new template directory go alongside, or under, the /languages/english directory?

Thanks.

mz

19 May 2008, 11:29 PM
#2
Kim avatar

Kim

Obaa-san

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

Re: correct directory structure for overrides?

The rule of thumb is your override directory will always be at the same level as the file that you are copying.

Example: includes/languages/english/header.php will be overridden by includes/languages/english/YOUR_TEMPLATE/header.php

20 May 2008, 1:11 AM
#3
mzimmers avatar

mzimmers

Zen Follower

Join Date:
May 2008
Posts:
453
Plugin Contributions:
0

Re: correct directory structure for overrides?

Thanks, Kim. So...is the first example incorrect, or is it a special case?

Is there any tutorial yet that talks about this stuff? I have a lot of similar questions coming up, but my searches of the FAQs doesn't turn much up. I hate to keep asking questions if the answers are already out there...

20 May 2008, 1:19 AM
#4
kobra avatar

kobra

Black Belt

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

Re: correct directory structure for overrides?

But in article https://www.zen-cart.com/tutorials/index.php?article=36 it says:

"Then, you can make any needed modifications in your new:

/includes/languages/custom/english.php"

So...I'm a little confused. Does the new template directory go alongside, or under, the /languages/english directory?
Read the complete reference as it refers only to what is highlighted in red and there were several other examples in both articles
Article:

Modifying the default Language File - /includes/languages/english.php

Example: You need to modify the title, so that instead of reading Zen Cart!, it reads Your Store Name!

Make a directory with the same name as your template name in /includes/languages, so you now have /includes/languages/custom.

Copy english.php to this directory.

Then, you can make any needed modifications in your new:

/includes/languages/custom/english.php

20 May 2008, 1:28 AM
#5
mzimmers avatar

mzimmers

Zen Follower

Join Date:
May 2008
Posts:
453
Plugin Contributions:
0

Re: correct directory structure for overrides?

OK, so why does the first example go underneath the "english" subdirectory?

20 May 2008, 1:44 AM
#6
kobra avatar

kobra

Black Belt

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

Re: correct directory structure for overrides?

OK, so why does the first example go underneath the "english" subdirectory?
Because that is where the file exists...

From the first article:

Modifying the default Language File - /includes/languages/english.php
Modifying Language Files - /includes/languages/english/.php (all files within this directory)
Modifying Template Files - /includes/templates/template_default/templates/tpl_
_default.php
Modifying Sidebox Templates
Modifying Sideboxe Modules - /includes/modules/sideboxes/*.php
etc. etc.
Basically, anywhere there exists a "classic" folder - then all files that are in that tree can be overriden and placed into a folder named for your template (NOTE: files and not folders)

20 May 2008, 2:46 AM
#7
mzimmers avatar

mzimmers

Zen Follower

Join Date:
May 2008
Posts:
453
Plugin Contributions:
0

Re: correct directory structure for overrides?

OK...I can see that I'm not doing a very good job of explaining my question. One of the articles talks about using overrides in order to make installing upgrades easier. Doesn't putting custom folders under the "english" directory violate this?

Another question: I assume that one could have multiple "custom" template directory structures. How does ZC know which one to use?

Thanks...I might be slow, but I think I'm getting it...

20 May 2008, 10:56 AM
#9
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: correct directory structure for overrides?

I have a pretty good understanding of the Zencart template structure, but having languages/MY_TEMPLATE and languages/english/MY_TEMPLATE always confused me, too. Still does, actually - I usually put english.php in the wrong one the first time.

20 May 2008, 2:26 PM
#10
kobra avatar

kobra

Black Belt

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

Re: correct directory structure for overrides?

OK...I can see that I'm not doing a very good job of explaining my question. One of the articles talks about using overrides in order to make installing upgrades easier. Doesn't putting custom folders under the "english" directory violate this?
When you navigate to a stock install to includes/languages - do you see a "classic" folder?
When you navigate to a stock install to includes/languages/english - do you see a "classic" folder?

The answer should be YES for both - and to reitterate -

Basically, anywhere there exists a "classic" folder - then all files that are in that tree can be overriden and placed into a folder named for your template (NOTE: files and not folders)