Zen Cart Logo
Forums / General Questions / Trouble With The Override For 'modules/pages'

Trouble With The Override For 'modules/pages'

Locked

Views: 2,057

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
7 Sep 2004, 11:18 AM
#1
jimmy_jazz avatar

jimmy_jazz

New Zenner

Join Date:
Aug 2004
Posts:
20
Plugin Contributions:
0

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

7 Sep 2004, 7:26 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Trouble With The Override For 'modules/pages'

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!```

<?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'; } ?>
9 Sep 2004, 10:15 AM
#3
jimmy_jazz avatar

jimmy_jazz

New Zenner

Join Date:
Aug 2004
Posts:
20
Plugin Contributions:
0

Re: Trouble With The Override For 'modules/pages'

Wow. Thanks so much DrByte! ::tup

25 Oct 2004, 4:44 AM
#4
texdc avatar

texdc

Zen Follower

Join Date:
Dec 2003
Posts:
135
Plugin Contributions:
1

Re: Trouble With The Override For 'modules/pages'

DrByte:

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