Results 1 to 10 of 12

Hybrid View

  1. #1
    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!

  2. #2
    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.

  3. #3
    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

  4. #4
    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?

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

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

    PHP Code:
    <h1 id="pageFourHeading"><?php echo General_Security_Tips?></h1>
    This needs to be
    PHP Code:
    <h1 id="pageFourHeading"><?php echo 'General Security Tips'?></h1>
    or else
    PHP Code:
    <h1 id="pageFourHeading"><?php echo GENERAL_SECURITY_TIPS?></h1>
    with
    PHP Code:
    define('GENERAL_SECURITY_TIPS''General Security Tips'); 
    in a language file like english.php, or a new language file for your custom defines.

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

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

    Thanks for the help guys, much appreciated!!

    I have my overrides working, my custom pages properly titled and my sanity back.

    I still have Home :: NAVBAR_TITLE showing at the top of the page, but it's only small, I'll work on it another time.

    Now all I have to do is install the latest Zencart version and hope I don't blow up my site in the process!

 

 

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