Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Feb 2009
    Posts
    23
    Plugin Contributions
    0

    Default Help, I still don't understand override folders

    hi Clever Zenned ones!

    I have tried and tried to understand the override folders, but still don't understand it. I have a live shop, so don't want to rock the boat, but need to update from 1.3.7.

    An example of my problem:

    I have an override folder here: catalog/includes/languages/my_custom/ and this works great

    But what about this custom page, (was page 2): catalog/includes/templates/template_default/templates/tpl_General_Security_Tips_default.php. There seems to be bits of the page config in lots of different folders.

    where should this override folder be? Should it be inside
    catalog/includes/templates/template_default/my_custom/
    or
    catalog/includes/templates/my_custom/
    or even
    catalog/includes/my_custom?

    Basically, I don't know what folder level to put my /my_custom/ folders in. Is it in the same level or back one, etc?

    Also: this is one of my pages; http://www.cctvireland.ie/catalog/in..._Security_Tips

    At the top of the page it says "Home" then "NAVBAR_TITLE" Which I don't want
    The Main heading is: "General_Security_Tips" which looks stupid with the underlines instead of spaces, but if I take them out the page doesn't display.

    I have spent ages trying to resolve this, but can't, so any help would be appreciated.

    I think one of the main problems is that some of my overrides work, and some don't. One of the biggest mistakes is that when I had an override folder that worked I didn't remove the default folder/file that was no longer needed, so am now totally confused with lots of near identical folders..

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

    Default Re: Help, I still don't understand override folders

    The override folder goes on the same level as the FOLDER of the file you are overriding, so if you are overriding includes/templates/template_default/templates/tpl_General_Security_Tips_default.php, it would go in includes/templates/my_custom/templates/tpl_General_Security_Tips_default.php

    This list is a bit outdated, but it'll give you an idea where to start to create a very basic custom template (you can build from there):
    • includes/languages/YOUR_TEMPLATE/english.php
    • includes/languages/english/YOUR_TEMPLATE/index.php
    • includes/languages/english/YOUR_TEMPLATE/meta_tags.php
    • includes/languages/english/YOUR_TEMPLATE/header.php (to change the logo and header text)
    • includes/templates/YOUR_TEMPLATE/template_info.php
    • includes/templates/YOUR_TEMPLATE/common/tpl_header.php <- may not be necessary
    • includes/templates/YOUR_TEMPLATE/common/tpl_footer.php <- may not be necessary
    • includes/templates/YOUR_TEMPLATE/images/logo.gif (or .jpg or .png)
    • includes/templates/YOUR_TEMPLATE/css/stylesheet.css


    Anywhere you see a /classic/ folder, you can create a folder for your custom template. You can copy the necessary files from either the /classic/ folder, the /template_default/ folder or the parent folder.

    Edit includes/templates/YOUR_TEMPLATE/template_info.php to give your template identifying information so you'll recognize it in the admin under tools->template selection.

    Note: if you've changed the height of the logo in header.php, you may need to change it in your stylesheet as well:

    #logoWrapper{
    background-image: url(../images/header_bg.jpg);
    background-repeat: repeat-x;
    background-color: #ffffff;
    height:75px; <-adjust this line if necessary
    }
    Mary Ellen
    I came; I saw; I Zenned
    Taking over the world... one website at a time
    Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

    Holzheimer
    Fan Odyssey

  3. #3
    Join Date
    Feb 2009
    Posts
    23
    Plugin Contributions
    0

    Default Re: Help, I still don't understand override folders

    Very helpful, very clear, very fast, thanks!

    now, maybe somebody could help me with the second half of my post.........

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

    Default Re: Help, I still don't understand override folders

    It appears you are editing the files incorrectly.

    The original definition of NAV_BAR_TITLE was probably something like this (I colored the single quotes to make it clearer):

    define('NAVBAR_TITLE', 'My Account');
    To remove the literal, it should look like this:

    define('NAVBAR_TITLE', '');
    To change the definition, it should look like this:
    define('NAVBAR_TITLE', 'Security Tips');
    Same applies for General_Security_Tips
    Last edited by afo; 24 Oct 2011 at 08:59 PM.
    Mary Ellen
    I came; I saw; I Zenned
    Taking over the world... one website at a time
    Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

    Holzheimer
    Fan Odyssey

  5. #5
    Join Date
    Feb 2009
    Posts
    23
    Plugin Contributions
    0

    Default Re: Help, I still don't understand override folders

    Ok, so I'm going through each file/folder one by one and I haven't quite got the hang of it:

    first:

    From:

    includes/languages/english/index.php

    into:

    includes/languages/english/my_custom/index.php

    (that doesn't seem right). When I moved this index.php the site still worked, but I then renamed it randomly and it still worked. Is it the right index.php file?

    Second:

    From:

    /includes/languages/english/before_process.php

    into:

    /includes/languages/english/my_custom/before_process.php

    I think this should be the right one:

    /includes/languages/CCTVIRELAND/english/before_process.php

    (This is a very important file for my CC transactions, is this the right location for the my_custom folder?).

    Third:

    includes/languages/english/my_custom/meta_tags.php

    where do I get this meta_tags.php from?


    Fourth:

    I moved header.php from:

    /includes/languages/english/header.php

    to:

    /includes/languages/my_custom/english/header.php

    It didn't work. Where should my_custom folder go?


    On the plus side:

    Overrides are now working perfectly for:
    english.php
    tpl_header.php
    tpl_footer.php
    template_info.php
    logo.jpg
    stylesheet.css

    Thanks for the help!

  6. #6
    Join Date
    May 2010
    Location
    WA State
    Posts
    1,678
    Plugin Contributions
    3

    Default Re: Help, I still don't understand override folders

    I moved header.php from:

    /includes/languages/english/header.php

    to:

    /includes/languages/my_custom/english/header.php

    It didn't work. Where should my_custom folder go?
    You have this one in the wrong order. Should be english/your_template/

  7. #7
    Join Date
    Feb 2009
    Posts
    23
    Plugin Contributions
    0

    Default Re: Help, I still don't understand override folders

    I have really confused myself now!

    I can't find: define('NAVBAR_TITLE' (Loads of these, but not the three relevent ones)

    I have searched using developers toolkit, all file look-ups

    All I can find is:

    <div class="centerColumn" id="General_Security_Tips">
    <h1 id="pageFourHeading"><?php echo General_Security_Tips; ?></h1>

    I feel very stupid now, I really need somebody to hold my hand on this!

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

    Default Re: Help, I still don't understand override folders

    One of the biggest mistakes is that when I had an override folder that worked I didn't remove the default folder/file that was no longer needed
    You should NEVER remove default files/folders. The whole point of overrides is that Zen Cart will auto-detect and use them instead of the default when they exist. In some cases, I believe the default files are needed to let Zen Cart know that there is something that can be overridden.

    The basic rule for override folders is, in /includes/templates/ folders you use /includes/templates/your_template_name/ followed by the exact same folder structure as /template_default/ has; in other areas (like /includes/languages/ and /includes/modules/) you create a mini /your_template/ folder in the same folder where the original file is (alongside the /classic/ folder). The /classic/ folders are guides to where you can use overrides. If there is no /classic/ folder, it is not possible to override the files at that level.

  9. #9
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Help, I still don't understand override folders

    Quote Originally Posted by paulclane View Post
    I have really confused myself now!

    I can't find: define('NAVBAR_TITLE' (Loads of these, but not the three relevent ones)
    I've just used the dev toolkit myself (to see if I can point you in the right direction) and unlike most of the zencart 'defines' (which are usually only found in one or two files) this particular one gets redefined dependent on which file is being used at any given time. This makes the task a little harder than usual for such settings. I can't explain why you can't see the relevent ones, unless someone has deleted them

    The "General_Security_Tips" is a different(?) issue, and I hope I don't offend anyone, but whoever coded this has no regard for coding standards.

    Quote Originally Posted by paulclane View Post
    <div class="centerColumn" id="General_Security_Tips">
    This is used for formatting/layout purposes. Somewhere in you .css files you should find a similar reference that would/should set various display parameters associated with this "id".
    If there are none, then the styling is effectively ignored. Defualt values are used.

    Quote Originally Posted by paulclane View Post
    <h1 id="pageFourHeading"><?php echo General_Security_Tips;
    This is where/why you are seeing "General_Security_Tips" rather than "General Security Tips". In simple terms, there isn't a 'define' for this entry, so the code is just displaying what it has (much the same reason why you are seeing "NAVBAR_TITLE" rather than something more useful).

    IF this is the *only* place where this supposed definition is used you can safely change the line to read
    <?php echo "General Security Tips" ;

    However, if it is used elsewhere then a definition will be in order, something along the lines of

    define('General_Security_Tips', 'General Security Tips');

    This is where/why I stated there is little regard to standards, because the "correct" define should be more like
    define('GENERAL_SECURITY_TIPS', 'General Security Tips');

    BUT, for this to work correctly, the code:

    <?php echo General_Security_Tips;

    will need to be modified to read:
    <?php echo GENERAL_SECURITY_TIPS;

    The same change will need to be made in any other place that uses "echo General_Security_Tips"

    If you can follow all of this I don't think you'll have too many other problems.

    If you can't follow it, just keep in mind that a 'define' that hasn't been defined will show the 'key' of the definition (which will almost always be in ALL_CAPS), rather than the text you actually want.

    Cheers
    Rod

  10. #10
    Join Date
    Feb 2009
    Posts
    23
    Plugin Contributions
    0

    Default Re: Help, I still don't understand override folders

    Apologies for being sooooo slow to respond:

    RescoCCC, the english.php re-direct is now working perfectly, Thanks!

    RodG, when I edit:

    <?php echo General_Security_Tips;
    to
    <?php echo General Security Tips; the content is blank

    when I add:

    define('General_Security_Tips', 'General Security Tips');

    I get this at the top of the page:

    General_Security_Tips
    define('General_Security_Tips', 'General Security Tips');

    So it's just treating it as text

    This is the entire .php:

    /**
    * Page Template
    *
    * @package templateSystem
    * @copyright Copyright 2003-2005 Zen Cart Development Team
    * @copyright Portions Copyright 2003 osCommerce
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    * @version $Id: tpl_page_4_default.php 3464 2006-04-19 00:07:26Z ajeh $
    */
    ?>
    <div class="centerColumn" id="General_Security_Tips">
    <h1 id="pageFourHeading"><?php echo General_Security_Tips; ?></h1>
    <?php if (DEFINE_PAGE_4_STATUS >= 1 and DEFINE_PAGE_4_STATUS <= 2) { ?>
    <div id="pageFourMainContent" class="content">
    <?php
    /**
    * require the html_define for the page_4 page
    */
    require($define_page);
    ?>
    </div>
    <?php } ?>

    <div class="buttonRow back"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?></div>
    </div>

    where should I add the define?

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Help, I don't understand how to install
    By haraaz in forum General Questions
    Replies: 1
    Last Post: 4 May 2011, 08:43 AM
  2. HELP -- In the middle of upgrading and don't understand..
    By kimhuff in forum Upgrading from 1.3.x to 1.3.9
    Replies: 4
    Last Post: 23 Aug 2010, 02:49 AM
  3. please help me better understand the template override system I've been making tons o
    By recordshow in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 16 Nov 2006, 01:04 PM
  4. Override issue...don't understand
    By Donnettacb in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 27 Jul 2006, 01:45 PM
  5. Please help me understand the override system.
    By angelicdezigns in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 9 Jul 2006, 06:06 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