Results 1 to 9 of 9
  1. #1
    Join Date
    Sep 2009
    Posts
    26
    Plugin Contributions
    0

    Default Confused about templates/customisation etc

    Right, I've been reading a few bits here and there about customising ZenCart.

    Let's pick just a simple couple of examples to kick off.

    1. I want to add some code to the product pages that will embed a video player. Basically, this will look up a new table with the product ID and if there is an entry then it will embed the player.

    2. I want to change the colour scheme of the entire site.


    Now, I'm getting confused because the articles I read tend to start by saying that you should always make a new folder in the languages folder and give it the new template name. And then they go ahead and tell me to change the file in the "english" folder. And sometimes they says the folder is "[CUSTOM]. I don't understand the correct approach. If I am supposed to copy any files I want to modify into a new folder named after my template, then how do I tell ZenCart to use this template?

    Thanks

  2. #2
    Join Date
    Aug 2004
    Location
    New York City
    Posts
    7,174
    Plugin Contributions
    0

    Default Re: Confused about templates/customisation etc

    You tell Zen Cart to use your custom template by selecting it from the pull down menu in admin>tools>template selection.

    The terms CUSTOM and YOUR_TEMPLATE are simply generic ways to refer to a custom template (or the override system). You can replace those terms with whatever you like. Each custom template must have a template_info.php file (in includes/templates/YOUR_TEMPLATE/) to identify it in the pull down menu I mentioned earlier.

    There are free templates available for Zen Cart. You can see them in action at http://(sorry, site offline)/ Using one of them may give you a jump start.

  3. #3
    Join Date
    Sep 2009
    Posts
    26
    Plugin Contributions
    0

    Default Re: Confused about templates/customisation etc

    Thanks.
    That helps to make sense of things a bit more. It's actually what I figured was required, but the documentation isn't very clear to me.
    I'll try this out tonight and post back if I'm still lost.

  4. #4
    Join Date
    Sep 2009
    Posts
    26
    Plugin Contributions
    0

    Default Re: Confused about templates/customisation etc

    OK, so I created a new folder in the /includes/template/ folder and then I can see this as an option in my Template Selection screen.

    So, if I want to be changing the text on a page, or perhaps adding a line of extra PHP code (e.g. to retrieve video IDs from the DB) should I be using my template to do this? Effectively, my template will be a copy of the Classic one and then I'll simply apply my changes to my template only.

    Or, is this done in some other way? I was of the impression that I could make a custom version of an individual page and that the templating system would use the default pages unless it found a custom one in the selected template folder.

  5. #5
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Confused about templates/customisation etc

    Your impression is correct. You use your template folders for saving the custom/override version of any files you edit.

  6. #6
    Join Date
    Sep 2009
    Posts
    26
    Plugin Contributions
    0

    Default Re: Confused about templates/customisation etc

    OK, but when I made the simplest of templates it didn't work in that way. Let me explain, I made a new folder and placed into just the template_info file, which I modified some details inside.

    Then I chose this as my template and checked my site. The result was completely different to the classic/default template. Should it not pick up the CSS etc. from the classic folder unless the file is within my custom template folder?

    Here's a before and after shot.

    Before

    After


    Hang on, am I getting confused between the Classic template and the Default template? Is my custom template based on the one in the "template_default" folder, whereas the Classic one is just one that is included with the ZenCart package?

  7. #7
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Confused about templates/customisation etc

    The Classic template is an override set of files/folders; if you make a new template and don't copy the /classic/ files, the default files in /template_default/ will be used until you add your customizations. You will always want a copy of stylesheet.css, and you should put your store-customized versions of english.php and other language files in your template folders.

  8. #8
    Join Date
    Sep 2009
    Posts
    26
    Plugin Contributions
    0

    Default Re: Confused about templates/customisation etc

    OK, so I could start my new custom template by copying the pre-installed Classic? That makes sense.

    What's this about putting my store-customized versions of english.php in my template folder? What does this file do and where would I put it within my template folder?

    As a side note, I just followed instructions to install the Cold Steel template and this included uploading "cold_steel" folders into the templates, languages and modules folders (and the sidebox sub-folder).

    I thought everything would go into the templates/my_custom_template folder.

  9. #9
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Confused about templates/customisation etc

    The fundamental approach to creating the override system, plus the multi-language capability, caused the distributed template folder setup. It makes individual file editing/comparing simpler at the cost of a more diffuse umbrella.

 

 

Similar Threads

  1. Getting confused on templates
    By janissaire in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 7 Jan 2010, 06:53 PM
  2. confused about installing on my PC
    By alma1 in forum Installing on a Windows Server
    Replies: 2
    Last Post: 25 Mar 2008, 06:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg