Forums / Templates, Stylesheets, Page Layout / I want to know how ZC templates work

I want to know how ZC templates work

Views: 1,052

Results 1 to 4 of 4
25 Oct 2016, 1:35 PM
#1
afam4eva avatar

afam4eva

New Zenner

Join Date:
Oct 2016
Posts:
1
Plugin Contributions:
0

I want to know how ZC templates work

Hello everyone, i'm new to this forum and i'm happy to start this new journey of getting acquainted with Zencart ecommerce cms. I just need some help on starting especially as it concerns in the structure and file system of zencart.

I tried using oscommerce but was discouraged due to it's poor template system. I like zencart better in that regard and that is why i have chosen it as my ecommerce cms. Due to the fact that i've never used zencart before, i just need to undersatand how it compared with Wordpress when we look at the template files and what they're used for. For instance, when creating a wordpress template, i would first create a HTML site and then add the wordpress tags to it thereby making it a wordpress site. I want to know if Zencart is anything like that. I ask because i have created an ecommerce html site and i want to know if zencart allows me to use some kind of php tags to make it specific to zencart or do i have to stick to some conventions in the html tags or css writeups. I hope i'm making sense.

25 Oct 2016, 3:32 PM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: I want to know how ZC templates work

Well, ZC is a little different in that regards. All content is "pieced together" through the template files. There is a file that provides the html header section, there's a template file that addresses the left side, one that addresses the right side, one for the middle, one for the footer. When addressing each of those, there are other files that are pulled in depending on other pieces of information, what page the customer is on, whether the page is being shown via https, etc...

If you have created such an html like page, then actually you would feed back to ZC some of what you have modified in order to get the look (and operation) you want.

For ZC 1.5.5, there are two provided "default" template themes. One is responsive and one is not. Briefly a template resides in its own folder off of the overrideable directories (there's a "plugin" available that shows the paths to each of these overrideable locations. It's basically an html file for viewing from your local computer.) what file(s) are not found in the template override file and needed/requested by the template system will be pulled from the template_default directory or the base overrideable directory.

I usually approach large modifications from two perspectives, from the inner files themselves and the html source code that is presented modifying from the top of the page down so that css can be properly inserted/adjusted as necessary for the desired affect. There are any of many ways to do this depending on what is being modified and what already has been.

Anyways, there's a few FAQS on the template system as can be found here: https://www.zen-cart.com/content.php?27-template-customization-building-overrides

Ideally you would start with your own set of folders for your new template such that the modifications you make do not disturb the underlying default files. The default files get "updated" with each new install/upgrade, so if your work can be added to other related files then they will remain when doing that upgrade, though may need some additional adjustments/alignment to the base files on the next upgrade.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

25 Oct 2016, 8:27 PM
#3
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,857
Plugin Contributions:
18

Re: I want to know how ZC templates work

IMHO, the major mistake that I (and others who came to ZC way more than just computer savvy) made was to come with the feeling of "I can fix that." No, I wasn't thinking that there was something broken or wrong. I just knew that my knowledge of html, css, programming, etc. was going to make this ecommerce stuff a snap. After all, I was two thirds completed with my own start of a coldfusion ecommerce site.
Well, it took me months to realize that I was not so smart after all. I often tell friends, "you can have a doctor's degree in keyboard, and not know a darn thing about mouse!"
It didn't matter that I had been programming since Sinclair Basic. I was more used to "tweaking" my own code. Heaven forbid having to take time to figure out how a community of folks put it together!
Often, items displayed right beside each other turned out to be controlled by file definition, database definition, or a query result. I often made the common mistake of jumping into a file and "fixing" it. Only at the first upgrade did I get my comeuppance. I spent days trying to put files back like they should be. Hours that could have been better spent on other projects were taken up trying to "un-fix" what I'd done. Then came the need to REALLY learn what controls the ZC output.
There are no html tags nor or there any "quick" fixes. However, the ultimate thing to remember is that time spent finding out how ZC works for any function IS time well spent.

From taking days to setup a site, I can now have a site "ready to sell" in a matter of hours. Not that we've gotten that smarter, we just "know where the bodies are buried."

The biggest thing in your favor is the forum. Use it. Sometimes a google search including Zen Cart works better than the forum search. If you think you didn't find an answer and need to post a thread, take the time to answer all the posting tip questions to help us to help you. Just like fingerprints, no two Zen Cart installations are the "same."

Lastly, take the time in reading the forum posts to include the similar threads at the end of a thread. Good info there as well.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

26 Oct 2016, 7:45 PM
#4
zean avatar

zean

Zen Follower

Join Date:
May 2009
Posts:
200
Plugin Contributions:
0

Re: I want to know how ZC templates work

afam4eva:

I ask because i have created an ecommerce html site and i want to know if zencart allows me to use some kind of php tags to make it specific to zencart or do i have to stick to some conventions in the html tags or css writeups. I hope i'm making sense.

I may be mistaken but from what I think you described you may be in for a big surprise. Zen Cart is probably going to be instead of rather than an adjunct to your existing eCommerce html site.