Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2004
    Posts
    613
    Plugin Contributions
    0

    Default trying to find the link to a file

    ok

    which file 'includes' or 'requires'

    /includes/modules/pages/index/main_template_vars.php

    basically I am using the multisite add on and would like two versions of that file so that I can display things slightly differently (I am wanting to split the product name and product description for one site but not the other)

    option 2 is to rewrite the original template to use the modified main_template_vars

    TIA

  2. #2
    Join Date
    Jun 2004
    Posts
    613
    Plugin Contributions
    0

    Default Re: trying to find the link to a file

    I have solved my problem

    after posting I found this

    Code:
    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';
      }
    in includes/templates/template_default/common/main_template_vars.php

    by replacing that code with

    Code:
    if (file_exists(DIR_WS_MODULES. $template_dir  .'/pages/' .$current_page_base . '/main_template_vars.php')) {
        $body_code = DIR_WS_MODULES. $template_dir  .'/pages/' .$current_page_base . '/main_template_vars.php';
    } elseif (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';
    }
    it works for me.

    I haven't tested it on other 'main_template_vars.php' files but this might answer this question

    http://www.zen-cart.com/forum/showthread.php?t=67898

  3. #3
    Join Date
    Jun 2004
    Posts
    613
    Plugin Contributions
    0

    Default Re: trying to find the link to a file

    just so it's clear

    the original main_template_vars.php file is here

    includes/modules/pages/index/main_template_vars.php

    the modified file goes here

    includes/modules/YOUR TEMPLATE NAME/pages/index/main_template_vars.php


    seems to be working so far

  4. #4
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: trying to find the link to a file

    An interesting idea. And since (I'm guessing) includes/templates/template_default/common/main_template_vars.php itself can be over-ridden, you have found a way to over-ride these rather key modules pages, completely via the over-ride system.

    I will have a go at retrofitting this to a large project that I have been working on recently and see how it goes.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  5. #5
    Join Date
    Jun 2004
    Posts
    613
    Plugin Contributions
    0

    Default Re: trying to find the link to a file

    Hi kuroi
    let me know how it goes.

    I think that my clarification post might have made things more confusing!

    so.

    I want to be able to modify files in the modules/pages directory, files that are not normally included in the templating system eg

    includes/modules/pages/index/main_template_vars.php

    this file is accessed by one of the template files

    includes/templates/template_default/common/main_template_vars.php

    so I modify includes/templates/template_default/common/main_template_vars.php

    with the code above.

    Once I have done that I am able to create template specific module files like
    includes/modules/MY_TEMPLATE/pages/index/main_template_vars.php


    hopefully it's a little clearer.

 

 

Similar Threads

  1. v155 I am trying to edit the right side box that says Sponsors How do I find the file?
    By bscho in forum Installing on a Linux/Unix Server
    Replies: 2
    Last Post: 19 Jul 2016, 12:26 PM
  2. Where to find the file that changes headings? Trying to undo some addons
    By luvstoxstitch in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 3 Aug 2011, 04:17 AM
  3. Where do I find this link file please
    By hello in forum General Questions
    Replies: 5
    Last Post: 19 Aug 2010, 03:14 AM
  4. Trying to find the correct settings, if itīs possible
    By magiana in forum Customization from the Admin
    Replies: 7
    Last Post: 31 Jul 2010, 12:24 PM
  5. Trying to add a link to a downloadable application form (.doc file)
    By NWCE in forum Setting Up Categories, Products, Attributes
    Replies: 11
    Last Post: 18 Oct 2009, 01:29 AM

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