Forums / General Questions / 2 ZC templates - how do I have 2 on one site?

2 ZC templates - how do I have 2 on one site?

Locked

Views: 1,914

Results 1 to 13 of 13
This thread is locked. New replies are disabled.
12 Apr 2007, 11:01 AM
#1
mex avatar

mex

Zen Follower

Join Date:
Feb 2007
Posts:
176
Plugin Contributions:
0

2 ZC templates - how do I have 2 on one site?

Hi,

Just to clarify having 2 ZC templates on the 1 ZC install. I have a custom folder and a custom2 folder. I have the custom2 folder under each custom folder and not inside 1 another of course.

Now on templates i have the choice of template custom or custom2. It picks it up ok but changing the relavant css file isn't easy. I am not getting all changes being picked up . That is another thread.

Is this how you have many templates on the 1 install though?

12 Apr 2007, 6:16 PM
#2
birdoasis avatar

birdoasis

Inactive

Join Date:
Jun 2005
Location:
Cheney WA
Posts:
1,123
Plugin Contributions:
0

Re: 2 ZC templates - how do I have 2 on one site?

You have differant templates simply by having the differant templates in their own folders.

The css files should be in each template folder.

So it sounds like you have it all correct. Try changing one stylesheet.css to custom.css and make sure you search the template folder for any referance to stylesheet.css and change it that referrance to custom.css as well.

I'd like to hear what happens so come back in here and let me know.

John Patrick
A Zen Cart Advocate!

13 Apr 2007, 12:11 AM
#3
mex avatar

mex

Zen Follower

Join Date:
Feb 2007
Posts:
176
Plugin Contributions:
0

Re: 2 ZC templates - how do I have 2 on one site?

Hi,

I thought to change the styleshet.css you just edit that file. Since i also changed some of the default tags in how they worked, i couldn't just add a new set of tags etc.
You said change the stylsheet.css to custom.css, so how does it know to override that name with the deafult stylesheet.css. I thought it would look for stylesheet.css?

13 Apr 2007, 12:23 AM
#4
mex avatar

mex

Zen Follower

Join Date:
Feb 2007
Posts:
176
Plugin Contributions:
0

Re: 2 ZC templates - how do I have 2 on one site?

I change the stylesheet.css to custom2.css. It just picks up the stylesheet in the other template folder custom.

I can't have 2 templates on ZC without interfering as the overrides don't work for css.
I have

/includes/templates/custom/stylesheet.css //picks up when custom2 template is loaded?
/includes/templates/custom2/stylesheet.css //doesn't pick up unless unique tags not in other styleheet

13 Apr 2007, 12:34 AM
#5
gjh42 avatar

gjh42

Black Belt

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

Re: 2 ZC templates - how do I have 2 on one site?

The overrides will work for multiple templates if you have set everything up correctly.
As you have done a lot of custom coding, it may be possible you have disabled some part of the override functioning. (And don't ask me how because I can't possibly know!: )
Or perhaps something is just not quite in the right place or named correctly.

13 Apr 2007, 1:08 AM
#6
mex avatar

mex

Zen Follower

Join Date:
Feb 2007
Posts:
176
Plugin Contributions:
0

Re: 2 ZC templates - how do I have 2 on one site?

Wel I don't know about the custom coding as most pages are just new pages. Other files that displayed stuff were just made to display different stuff with different file names.
I avoiding changing files and just added different files for display as i didn't want to rewrite original files. As problem might occur.

My changes eg css style were just styling issues not working at all. Eg tagline div was made to display the color blue on a heading on my custom template but i changed this to red on custom2. Blue came up even if i changed the css style in custom to red. The header file had just stayed the same throughout (same files being called as original ) and i couldn't change the style on that.

The setup looks ok. Maybe i will need to look at a new install and alter that and try again with another template. I was always a little uneasy about having 2 templates on the 1 install but maybe this can be fixed.

13 Apr 2007, 1:17 AM
#7
gjh42 avatar

gjh42

Black Belt

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

Re: 2 ZC templates - how do I have 2 on one site?

If you have added completely new pages, perhaps there is a place they need to be referenced so the overrides "know" to work...
DrByte will be able to answer that.

13 Apr 2007, 2:05 AM
#8
mex avatar

mex

Zen Follower

Join Date:
Feb 2007
Posts:
176
Plugin Contributions:
0

Re: 2 ZC templates - how do I have 2 on one site?

I did add completely new pages but that wasn't the problem For example the tpl_header is the same which calls 'my header' for the whole thing with its own tags. Now I couldn't change that?

I did change the original stylesheet.css witha few cosmetic things. I will need to try a new install to see if i get the same error with small changes and 2 templates.

13 Apr 2007, 2:23 AM
#9
gjh42 avatar

gjh42

Black Belt

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

Re: 2 ZC templates - how do I have 2 on one site?

Actually it is supposed to be possible to use a custom tpl_header.php or tpl_main_page.php on a single page. (Read the comments at the top of one of those files.) However, I have tried it and it didn't work for me... I think I remember reading that something else had to be done to get those overides recognized, but can't remember what.

13 Apr 2007, 5:50 AM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: 2 ZC templates - how do I have 2 on one site?

Every file under the /includes/templates folder is overridable.
Just follow the pattern.
There are lots of tutorials out there explaining it in different ways.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

13 Apr 2007, 6:27 AM
#11
mex avatar

mex

Zen Follower

Join Date:
Feb 2007
Posts:
176
Plugin Contributions:
0

Re: 2 ZC templates - how do I have 2 on one site?

I have another thread which has ended up similar to this.
I think i have found the problem.
You shouldn't alter default tags much or delete code that isn't needed instead of commenting it out.
Although the changes i did were minor, it isn't working so i am redoing it . So far so good.

13 Apr 2007, 7:39 AM
#12
kuroi avatar

kuroi

Totally Zenned

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

Re: 2 ZC templates - how do I have 2 on one site?

Sorry Mex, I don't agree. There's nothing wrong with stripping out code your site doesn't use or altering default tags to suit your site's needs - in fact I'd recommend it, as it makes your template easier to understand and maintain.

But all this needs to be done to over-ride files in the right structure. The symptoms that you have described suggest that it is your site structure that's not quite right for your two templates, but there's not really enough information here to be able to see what's wrong with it.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

13 Apr 2007, 11:43 AM
#13
mex avatar

mex

Zen Follower

Join Date:
Feb 2007
Posts:
176
Plugin Contributions:
0

Re: 2 ZC templates - how do I have 2 on one site?

Hi,

I don't know what the hell i did. It is fri 13th and it started acting odd and i can't seem to find the error. The overrides seem in the right place and a gave the dir structure.

NOw what i did was redo my site. I did alter tags a lot and even deleted ones I didn't use, as well as from code. I deleted code i didn't use either from some parts but it all worked fine until fri 13th when i had another template to add ( a backup of the 1st).

I made a more sensible approach to editing adding my own tags and making small changes to default ones. I can also add another template with it mostly finished with no problems as i am testing all the way. Just copying and pasting where i need to or editing.

Maybe this was a better way to go anyway.