Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2004
    Posts
    21
    Plugin Contributions
    0

    Default Trouble With The Override For 'modules/pages'

    hi

    Could someone point me in the right direction.

    Im trying to remove the hspace="5" vspace="5" that is applied to the medium image in the product info page.

    Ive located the code - its in Modules/pages/product_info/main_template_vars_images.php

    When i remove the said code from the master file it works as required. Obviously I want to override though. Where do i put the override folder. Sorry if this sound like a dumb question. Ive tried the following and they dont seem to work:

    Modules/MY_TEMPLATE/pages/product_info/main_template_vars_images.php

    and

    Modules/pages/MY_TEMPLATE/product_info/main_template_vars_images.php

    Where am i going wrong?

    Thanks

  2. #2
    Join Date
    Jan 2004
    Posts
    66,380
    Blog Entries
    7
    Plugin Contributions
    274

    Default

    jimmy_jazz,

    There is no official override at present for the "modules/pages" folder.

    However, I just threw this hack together which may help you!
    Code:
    <?php
    // common/main_template_vars.php to permit per-page overrides of the main_template_vars.php scripts in modules/pages
    // $Id: main_template_vars.php 2004-09-07 DrByteZen $
    // 
    // TO USE: 
    // 1. Put this file into /includes/templates/YOURTEMPLATE/common/main_template_vars.php
    // 2. Next, under a modules/pages/PAGENAME folder, create a YOURTEMPLATE folder 
    //  and insert your customized main_template_vars.php for that page
    //  For example:
    //   copy:
    //    /includes/modules/pages/product_info/main_template_vars.php
    //   to:
    //    /includes/modules/pages/product_info/classic/main_template_vars.php
    //  and edit this new file to include the changes you desire to have override the original main_template_vars.php file.
    //  NOTE: if the main_template_vars.php calls other files (like main_template_images_vars.php), you'll need to manually add
    //     your templatename into the path to the main_template_images_vars.php file IF you are trying to override that one too.
    //    EXAMPLE:
    //    /includes/modules/pages/product_info/classic/main_template_vars.php
    //    /includes/modules/pages/product_info/classic/main_template_images_vars.php
    //    To use this "classic" version of the main_template_images_vars.php, 
    //    you'd have to hard-code the "classic" path into your customized ..../classic/main_template_vars.php file.
    //
     if (file_exists(DIR_WS_MODULES . 'pages/' . $current_page_base . '/' . $template_dir . '/main_template_vars.php')) {
      $body_code = DIR_WS_MODULES . 'pages/' . $current_page_base . '/' . $template_dir . '/main_template_vars.php';
     } else if (file_exists(DIR_WS_MODULES . 'pages/' . $current_page_base . '/main_template_vars.php')) {
      $body_code = DIR_WS_MODULES . 'pages/' . $current_page_base . '/main_template_vars.php';
     } else {
      $body_code = $template->get_template_dir('tpl_' . preg_replace('/.php/', '',$_GET['main_page']) . '_default.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_' . $_GET['main_page'] . '_default.php';
     }
     
    ?>
    .

    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.

  3. #3
    Join Date
    Aug 2004
    Posts
    21
    Plugin Contributions
    0

    Default

    Wow. Thanks so much DrByte! ::tup

  4. #4
    Join Date
    Dec 2003
    Posts
    145
    Plugin Contributions
    0

    Default

    Originally posted by DrByte@Sep 7 2004, 01:26 PM
    There is no official override at present for the "modules/pages" folder.

    However, I just threw this hack together which may help you!
    Thanks, Dr. B! This is exactly what I was looking for, I hope it becomes official. ::tup

 

 

Similar Threads

  1. Override vs Overwrite for modules/pages files
    By Treadle in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 19 Jul 2011, 05:21 PM
  2. is is true that can't override the pages under modules?
    By Cindy2010 in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 1 Mar 2011, 07:20 AM
  3. Override for includes/modules/pages?
    By dbrewster in forum Templates, Stylesheets, Page Layout
    Replies: 14
    Last Post: 27 Jan 2007, 04:51 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR