Results 1 to 10 of 10
  1. #1
    Join Date
    May 2008
    Posts
    452
    Plugin Contributions
    0

    Default correct directory structure for overrides?

    Hi -

    In article https://www.zen-cart.com/tutorials/i...hp?article=127 it says:

    "Save the edited file to includes/languages/english/custom/header.php and upload it to your server."

    But in article https://www.zen-cart.com/tutorials/index.php?article=36 it says:

    "Then, you can make any needed modifications in your new:

    /includes/languages/custom/english.php"


    So...I'm a little confused. Does the new template directory go alongside, or under, the /languages/english directory?

    Thanks.

    mz

  2. #2
    Join Date
    Jun 2003
    Posts
    33,721
    Plugin Contributions
    0

    Default Re: correct directory structure for overrides?

    The rule of thumb is your override directory will always be at the same level as the file that you are copying.

    Example: includes/languages/english/header.php will be overridden by includes/languages/english/YOUR_TEMPLATE/header.php
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  3. #3
    Join Date
    May 2008
    Posts
    452
    Plugin Contributions
    0

    Default Re: correct directory structure for overrides?

    Thanks, Kim. So...is the first example incorrect, or is it a special case?

    Is there any tutorial yet that talks about this stuff? I have a lot of similar questions coming up, but my searches of the FAQs doesn't turn much up. I hate to keep asking questions if the answers are already out there...

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: correct directory structure for overrides?

    But in article https://www.zen-cart.com/tutorials/index.php?article=36 it says:

    "Then, you can make any needed modifications in your new:

    /includes/languages/custom/english.php"


    So...I'm a little confused. Does the new template directory go alongside, or under, the /languages/english directory?
    Read the complete reference as it refers only to what is highlighted in red and there were several other examples in both articles
    Quote Originally Posted by Article
    Modifying the default Language File - /includes/languages/english.php

    Example: You need to modify the title, so that instead of reading Zen Cart!, it reads Your Store Name!

    Make a directory with the same name as your template name in /includes/languages, so you now have /includes/languages/custom.

    Copy english.php to this directory.

    Then, you can make any needed modifications in your new:

    /includes/languages/custom/english.php
    Zen-Venom Get Bitten

  5. #5
    Join Date
    May 2008
    Posts
    452
    Plugin Contributions
    0

    Default Re: correct directory structure for overrides?

    OK, so why does the first example go underneath the "english" subdirectory?

  6. #6
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: correct directory structure for overrides?

    OK, so why does the first example go underneath the "english" subdirectory?
    Because that is where the file exists...

    From the first article:
    Modifying the default Language File - /includes/languages/english.php
    Modifying Language Files - /includes/languages/english/*.php (all files within this directory)
    Modifying Template Files - /includes/templates/template_default/templates/tpl_*_default.php
    Modifying Sidebox Templates
    Modifying Sideboxe Modules - /includes/modules/sideboxes/*.php
    etc. etc.
    Basically, anywhere there exists a "classic" folder - then all files that are in that tree can be overriden and placed into a folder named for your template (NOTE: files and not folders)
    Zen-Venom Get Bitten

  7. #7
    Join Date
    May 2008
    Posts
    452
    Plugin Contributions
    0

    Default Re: correct directory structure for overrides?

    OK...I can see that I'm not doing a very good job of explaining my question. One of the articles talks about using overrides in order to make installing upgrades easier. Doesn't putting custom folders under the "english" directory violate this?

    Another question: I assume that one could have multiple "custom" template directory structures. How does ZC know which one to use?

    Thanks...I might be slow, but I think I'm getting it...

  8. #8
    Join Date
    Dec 2005
    Posts
    1,059
    Plugin Contributions
    2

    Default Re: correct directory structure for overrides?

    Also look over these two tutorials:

    https://www.zen-cart.com/tutorials/i...hp?article=230

    https://www.zen-cart.com/tutorials/i...hp?article=143


    You can have as many "custom" templates installed as you want. Each would
    have a unique name, and be selectable via the Admin/Tools/Template Selection.
    [FONT=Arial]Country Kitty Crafts[/FONT][FONT=Arial]
    [/FONT] [FONT=Garamond]
    [/FONT]

  9. #9
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

    Default Re: correct directory structure for overrides?

    I have a pretty good understanding of the Zencart template structure, but having languages/MY_TEMPLATE and languages/english/MY_TEMPLATE always confused me, too. Still does, actually - I usually put english.php in the wrong one the first time.

  10. #10
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: correct directory structure for overrides?

    OK...I can see that I'm not doing a very good job of explaining my question. One of the articles talks about using overrides in order to make installing upgrades easier. Doesn't putting custom folders under the "english" directory violate this?
    When you navigate to a stock install to includes/languages - do you see a "classic" folder?
    When you navigate to a stock install to includes/languages/english - do you see a "classic" folder?

    The answer should be YES for both - and to reitterate -

    Basically, anywhere there exists a "classic" folder - then all files that are in that tree can be overriden and placed into a folder named for your template (NOTE: files and not folders)
    Zen-Venom Get Bitten

 

 

Similar Threads

  1. Loading Flash - Correct File Structure
    By willowisp in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 12 Jul 2010, 12:11 AM
  2. Directory structure
    By VisExp in forum General Questions
    Replies: 2
    Last Post: 8 Nov 2008, 11:20 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