Forums / Templates, Stylesheets, Page Layout / After all tutorials, how do I create a template?

After all tutorials, how do I create a template?

Locked

Views: 14,709

Results 21 to 34 of 34
This thread is locked. New replies are disabled.
23 Aug 2007, 3:41 PM
#21
drbyte avatar

drbyte

Sensei

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

After all tutorials, how do I create a template?

warstormer:

I have the default Classic Contemporary Green so to create my own I can copy the template_default folder, rename it, then play with those files? ...
You don't need to copy the entire folder.

The overrides system lets you only copy the files that you make changes to.

So for example ... if you don't need to alter the look/feel/functionality of the login page, then ... you don't need to duplicate the login page files.

If you're going to customize something, make a copy of it from template_default, put that copy into the same folder structure under your new template, and make your changes there.

.
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.

23 Aug 2007, 3:54 PM
#22
warstormer avatar

warstormer

Zen Follower

Join Date:
Aug 2007
Posts:
120
Plugin Contributions:
0

Re: After all tutorials, how do I create a template?

DrByte:

You don't need to copy the entire folder.

The overrides system lets you only copy the files that you make changes to.

So for example ... if you don't need to alter the look/feel/functionality of the login page, then ... you don't need to duplicate the login page files.

If you're going to customize something, make a copy of it from template_default, put that copy into the same folder structure under your new template, and make your changes there.

So I create my new template folder and select it in Template Selection, then in 'common' I have my own tpl_header.php file.. Will zen-cart automatically use that tpl_header.php file over the one in template_default? Is there something else I need to do regarding overrides?

23 Aug 2007, 3:58 PM
#23
drbyte avatar

drbyte

Sensei

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

Re: After all tutorials, how do I create a template?

warstormer:

So I create my new template folder and select it in Template Selection, then in 'common' I have my own tpl_header.php file.. Will zen-cart automatically use that tpl_header.php file over the one in template_default?Yes -- that's what's meant by the term "override" ... your custom file "overrides" the master ... ie: your custom file is used INSTEAD OF the original/master/default version of that file.

.
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.

23 Aug 2007, 4:16 PM
#24
warstormer avatar

warstormer

Zen Follower

Join Date:
Aug 2007
Posts:
120
Plugin Contributions:
0

Re: After all tutorials, how do I create a template?

DrByte:

Yes -- that's what's meant by the term "override" ... your custom file "overrides" the master ... ie: your custom file is used INSTEAD OF the original/master/default version of that file.

Right, that bit actually makes perfect sense now. :wink: Now it's just a case of figuring the page structures so I know which template files control what.....

23 Aug 2007, 5:32 PM
#25
xjamathonx avatar

xjamathonx

New Zenner

Join Date:
Jun 2007
Posts:
30
Plugin Contributions:
0

Re: After all tutorials, how do I create a template?

Squeakypants.. your design is very VERY achievable in Zen Cart so don't fear... There is no current diagram of what does what in the new version of Zen (to my knowledge).. What I mean by that is there's not really a cheat sheet that says navwrapper is for the header, navmain is the for the upper log in and home text etc... It will take a lot of work and digging on your part. What I suggest you do is what was suggested to me is download FireFox with the Firebug add on.. Open it in a new window, click inspect then go back over to your current zencart and watch the magic unfold before your eyes when you can visually see what each wrapper and div is... It sounds like you come from a design more than code background like myself and the visual will help you out a ton...,

while i love mitea.com as much as the next person and admittedly it's what got me interested in Zen Cart years ago, it, and most other stores that look amazing seem to use the older table base versions of Zencart.. While I am not saying the look isn't achievable now, it certainly seems to be a bit tricker to make some of the functions (like roll overs in navmain for home, and login, etc) a bit harder to place...

Zen really is very very flexible as far as design goes.. My goals are simple and clean and very non standard Zen and through the help of the tutorials and good people of the forum I have been able to get closer and closer to reaching them...

23 Aug 2007, 6:36 PM
#26
gjh42 avatar

gjh42

Black Belt

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

Re: After all tutorials, how do I create a template?

Squeakypants' original post is a year old... it got me at first too. It appears he got the site basically done, though it is simplified from the mockup. It could have been done exactly as the mockup showed (though I don't know about the transparent borders around the sideboxes).

Warstormer, the page output starts with /your_template/common/tpl_main_page.php, which calls the sections of the page in sequence. Looking at that will give you the start of understanding the page structure.

24 Aug 2007, 3:26 PM
#27
warstormer avatar

warstormer

Zen Follower

Join Date:
Aug 2007
Posts:
120
Plugin Contributions:
0

Re: After all tutorials, how do I create a template?

gjh42:

Squeakypants' original post is a year old... it got me at first too. It appears he got the site basically done, though it is simplified from the mockup. It could have been done exactly as the mockup showed (though I don't know about the transparent borders around the sideboxes).

Warstormer, the page output starts with /your_template/common/tpl_main_page.php, which calls the sections of the page in sequence. Looking at that will give you the start of understanding the page structure.

Ok, I'll start with tpl_main_page.php as you suggest.... if only people weren't breathing down my neck to get this done in like a week...! Thanks again everyone for the advice... :wink:

24 Aug 2007, 3:37 PM
#28
xjamathonx avatar

xjamathonx

New Zenner

Join Date:
Jun 2007
Posts:
30
Plugin Contributions:
0

Re: After all tutorials, how do I create a template?

gjh42:

Squeakypants' original post is a year old... it got me at first too. It appears he got the site basically done, though it is simplified from the mockup. It could have been done exactly as the mockup showed (though I don't know about the transparent borders around the sideboxes).
.

Haha looks like I could stand to check dates a bit more closely!:blush:

19 Feb 2008, 8:43 AM
#29
ttb avatar

ttb

New Zenner

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

Re: After all tutorials, how do I create a template?

DrByte:

Yes -- that's what's meant by the term "override" ... your custom file "overrides" the master ... ie: your custom file is used INSTEAD OF the original/master/default version of that file.

so, simply by making the custom file, zen cart knows automatically to look at the "custom file" instead of the "original file?

19 Feb 2008, 9:08 AM
#30
gjh42 avatar

gjh42

Black Belt

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

Re: After all tutorials, how do I create a template?

That's right, any time Zen Cart is about to use a template or module file, it first checks in the current template's structure to see if there is a custom version. If there isn't, then it uses the default version of the file.

19 Feb 2008, 9:18 AM
#31
ttb avatar

ttb

New Zenner

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

Re: After all tutorials, how do I create a template?

it looks like I should have a "CUSTOM" folder inside the templates folder, correct? but there is already an Atheme template I installed, so there is an Atheme folder in addition to the classic and what will be the CUSTOM folder. is that ok?

19 Feb 2008, 9:28 AM
#32
gjh42 avatar

gjh42

Black Belt

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

Re: After all tutorials, how do I create a template?

You can have as many custom templates as you want, as long as you don't get confused. Name your new template folder whatever is meaningful to you.

19 Feb 2008, 9:48 AM
#33
ttb avatar

ttb

New Zenner

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

Re: After all tutorials, how do I create a template?

gjh42:

That's right, any time Zen Cart is about to use a template or module file, it first checks in the current template's structure to see if there is a custom version. If there isn't, then it uses the default version of the file.

gjh42:

You can have as many custom templates as you want, as long as you don't get confused. Name your new template folder whatever is meaningful to you.

Wouldn't Zen Cart get confused, since I now have a "custom" folder, as well as an "atheme" folder? there would be 2 custom versions now, how does it know which one to use? is it based on which template i select in the admin profile?

19 Feb 2008, 4:34 PM
#34
gjh42 avatar

gjh42

Black Belt

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

Re: After all tutorials, how do I create a template?

It knows which template is active (selected in admin) and bases its actions on that. Inactive template folders will be ignored.