Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2010
    Posts
    205
    Plugin Contributions
    0

    Default Addressing the YOUR_TEMPLATE issue

    Like many people on this forum, I am not a programmer. Through sweat, tenacity and untold hours I've finally figured out how to move things around.

    But one thing I have not done is setup a file directory for YOUR_TEMPLATE because I don't understand how it actually works. So I have been rolling along just changing the files I need to change and everything seems to be working fine.

    What I'm concerned about is what (if any) problems not having a YOUR_TEMPLATE folder is going to cause my website to have.

    If it's something that needs to be changed, please let me know where I can go to find a basic (not over your head) description of how to do this.

    And most important, what effect will this have on all of the modifications I've already made to my existing pages ?

    Regards,
    Mitch

  2. #2
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Addressing the YOUR_TEMPLATE issue

    Zen Cart allows you to build multiple templates, even in multiple languages, for your site. This allows you not only to personalize the site to your unique needs, but also to set up separate themes for things like "spring sale" or "mothers day" (special graphics and color changes to suit the season), or Christmas, and so on.

    Under the /includes/templates/ folder you'll find 2 such templates, by default: template_default, and classic.

    The template_default folder contains all the original master files, and normally is not touched when making customizations.
    The classic folder is an example template showing how easy it is to have customized files which override the masters.

    So, the concept works like this:

    - in the template_default folder you'll find several folders and files
    - you've been editing THOSE files directly (while that will work if you only ever intend to have ONE theme/template, it's not recommended)
    - the correct way to do your own "template" is to create another folder, such as "my_fancy_template" or "fred" or "site1" or "mychristmas" under /includes/templates
    .... thus you'd have "my_fancy_template" folder in the same place as you now find "template_default" and "classic"
    - now, instead of editing files/folders under template_default, you'll create the same file under "my_fancy_template" and make your changes *there*. Zen Cart will check your active template (assuming you've made "my_fancy_template" your primary template via the admin selections page), and if it finds a file it's looking for in your "my_fancy_template" folder structure, it will use that; otherwise it will go and use template_default.
    - so, if you were changing tpl_main_page, then you would create an /includes/templates/my_fancy_template/common/tpl_main_page.php file by creating the /includes/templates/my_fancy_template/common/ folder using your FTP program, and then COPY the template_default/common/tpl_main_page.php file into the my_fancy_template/common/ folder. Then make your changes in the my_fancy_template version of the file.
    - same with css files: work in /includes/templates/my_fancy_template/css/ instead of .../template_default/css/

    This is all explained in many FAQ articles on the topic:
    https://www.zen-cart.com/tutorials/i...hp?article=142
    https://www.zen-cart.com/tutorials/i...hp?article=143
    https://www.zen-cart.com/tutorials/i...hp?article=346
    http://www.zen-cart.com/index.php?ma...roducts_id=298
    .

    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.

 

 

Similar Threads

  1. What is YOUR_TEMPLATE?
    By Seeker88 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 5 Apr 2011, 11:59 PM
  2. PHP Addressing
    By IATIA in forum Templates, Stylesheets, Page Layout
    Replies: 10
    Last Post: 27 Dec 2009, 03:42 PM

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