Forums / Addon Templates / Pointing downloaded templates to existing files

Pointing downloaded templates to existing files

Locked

Started by mamasylvia on 24 Mar 2008, 9:56 PM · Views: 1,713

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
24 Mar 2008, 9:56 PM
#1
mamasylvia avatar

mamasylvia

Zen Follower

Join Date:
Feb 2008
Posts:
379
Plugin Contributions:
0

Pointing downloaded templates to existing files

I've tried several of the downloadable templates, and I have a general question. Some of the templates point to existing files and some don't. I can tell because with some templates, my store name and customized main page and other page scripts show up, and with others the default text that needs to be changed show up.

So what in the downloaded files can be safely changed, and how? Obviously I don't want to change the colors, size, or location of items. I just want the new templates to pick up the store name and various pages that I've edited. And I'd rather change the template once, to point to the edited files (and edit them when I want to make changes), than copy the edited pages all over the place whenever I change templates.

If someone PHP- and CSS-knowledgable could tell me what to do, I'd sure appreciate it.

Sylvia
PM at your own risk, I don't check in regularly!
MamaSylvia.com My ZenCart tutorial

25 Mar 2008, 12:52 AM
#2
clydejones avatar

clydejones

Deceased

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

Re: Pointing downloaded templates to existing files

mamasylvia:

I've tried several of the downloadable templates, and I have a general question. Some of the templates point to existing files and some don't. I can tell because with some templates, my store name and customized main page and other page scripts show up, and with others the default text that needs to be changed show up.

So what in the downloaded files can be safely changed, and how? Obviously I don't want to change the colors, size, or location of items. I just want the new templates to pick up the store name and various pages that I've edited. And I'd rather change the template once, to point to the edited files (and edit them when I want to make changes), than copy the edited pages all over the place whenever I change templates.

If someone PHP- and CSS-knowledgable could tell me what to do, I'd sure appreciate it.

copy any files you edit to the appropriate template folder:

for instance if you edit includes/templates/template_default/templates/tpl_product_info_display.php

you would copy the and save the edited file to
includes/templates/NEW_TEMPLATE/templates/tpl_product_info_display.php

The upload this to your server.

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

25 Mar 2008, 1:09 AM
#3
gjh42 avatar

gjh42

Black Belt

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

Re: Pointing downloaded templates to existing files

The practicality of this probably varies by template. Some templates only touch a few files and you might be able to do some recoding to make the basic custom versions be used. Some templates may have edits in some of those files already, and thus can't use another file version at the same time.

At any rate, it will be a lot more complicated to change some of the template file calls than to copy the edited files into each template.

And really, if your customizations are showing up in other templates, that means the custom text is in a core file, which is going to be erased when you upgrade to a newer version of Zen Cart. You need to copy all of your customizations into template override folders where they will be safe. Remembering which core files you edited six months from now is going to be chancy at best.

25 Mar 2008, 1:43 AM
#4
mamasylvia avatar

mamasylvia

Zen Follower

Join Date:
Feb 2008
Posts:
379
Plugin Contributions:
0

Re: Pointing downloaded templates to existing files

copy any files you edit to the appropriate template folder

This is exactly what I'm trying NOT to do. First, because it's a pain, and second, because some of the templates have their own files and some don't. It's actually less of a pain (to me) to go through all the possible files ONCE and then have everything looking to the same fileset than try to remember when I switch templates "okay, now what do I need to copy where?"

the custom text is in a core file, which is going to be erased when you upgrade to a newer version of Zen Cart

Actually, that has already occurred to me. But hopefully in 6 months, I'll be such a Zen whiz that I'll know which files I need to keep safe.

You need to copy all of your customizations into template override folders

<perking ears up> Huh? What are override folders and what do they do? Can I put the page files in one now and point the various templates to it?

Always eager to learn,

Sylvia
PM at your own risk, I don't check in regularly!
MamaSylvia.com My ZenCart tutorial

25 Mar 2008, 1:56 AM
#5
mamasylvia avatar

mamasylvia

Zen Follower

Join Date:
Feb 2008
Posts:
379
Plugin Contributions:
0

Re: Pointing downloaded templates to existing files

I found some tutorials on the override system and read them.

Okay, now I'm going to get frustrated again. Nearly all my problems as a beginning Zen user came because people told me to copy my changes into the /custom subdirectory. THAT NEVER WORKED! Let me emphasize: THAT NEVER NEVER NEVER WORKED! Every change that I successfully made came when I edited the file according to directions on my own computer, saved the changed file to a /custom directory on my own computer, then uploaded the changed file into the ORIGINAL directory on the server. (That way, I had a copy of the original file in case my edited file blew up the store, which happened way too often.)

My ZenCart version 1.3.8a does NOT look in a /custom directory first before it looks at the default file. Is there a switch somewhere I should have turned on?

Sylvia
PM at your own risk, I don't check in regularly!
MamaSylvia.com My ZenCart tutorial

25 Mar 2008, 2:10 AM
#6
clydejones avatar

clydejones

Deceased

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

Re: Pointing downloaded templates to existing files

mamasylvia:

I found some tutorials on the override system and read them.

Okay, now I'm going to get frustrated again. Nearly all my problems as a beginning Zen user came because people told me to copy my changes into the /custom subdirectory. THAT NEVER WORKED! Let me emphasize: THAT NEVER NEVER NEVER WORKED! Every change that I successfully made came when I edited the file according to directions on my own computer, saved the changed file to a /custom directory on my own computer, then uploaded the changed file into the ORIGINAL directory on the server. (That way, I had a copy of the original file in case my edited file blew up the store, which happened way too often.)

My ZenCart version 1.3.8a does NOT look in a /custom directory first before it looks at the default file. Is there a switch somewhere I should have turned on?

"/custom" is a generic term used int the tutorials to describe whatever new directory you decide to use. These directories can be named anything you want.

You are using the mystic river template (the override directories for that template are called "mystic")

if you edit any files they should be saved in the "mystic" folder(s)

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

25 Mar 2008, 4:41 AM
#7
mamasylvia avatar

mamasylvia

Zen Follower

Join Date:
Feb 2008
Posts:
379
Plugin Contributions:
0

Re: Pointing downloaded templates to existing files

"/custom" is a generic term

I understand that. But I did set up custom subdirectories when I first started trying to make modifications, and uploading the changed files into them did NOT product a change in the store appearance.

Sylvia
PM at your own risk, I don't check in regularly!
MamaSylvia.com My ZenCart tutorial

25 Mar 2008, 11:25 AM
#8
stevesh avatar

stevesh

Black Belt

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

Re: Pointing downloaded templates to existing files

Then you would have to change the template to 'Custom' and be sure you edited the template_info.php file.

(That's if I understand your last post correctly - Zencart doesn't in any instance automatically look for a 'Custom' override folder.)

25 Mar 2008, 4:00 PM
#9
mamasylvia avatar

mamasylvia

Zen Follower

Join Date:
Feb 2008
Posts:
379
Plugin Contributions:
0

Re: Pointing downloaded templates to existing files

I accidentally figured out how to do what I wanted. Zen DOES look for the page files in the includes/languages/english/html_includes folder if that folder doesn't have a sub-folder with the template name! All I had to do was delete the page files from the sub-folders and now Zen is doing exactly what I wanted.

I understand the concern about overwriting files when upgrading, but sheesh, why doesn't Zen Cart look for changed files during upgrade? That feature has been around a LONG time in other programs. Netscape, Office, and a few other programs on my laptop do it. Even Managing Your Money, an old DOS program I was a beta tester for, looked for changed files and kept them intact when upgrading. (I'm a great beta tester, if it's possible to break the program I do -- without trying.)

IAC, if the next version of Zen Cart doesn't identify and convert changed files, it will be easy enough to simply do a new install instead of an upgrade and then copy over the test from my changed files.

Sylvia
PM at your own risk, I don't check in regularly!
MamaSylvia.com My ZenCart tutorial