Can this be applied for Categories box?
Axel
Printable View
Can this be applied for Categories box?
Axel
You can control all sideboxes by setting a given condition and just not letting it run ...
Same holds true of any page, column, centerbox, etc.
That is the beauty of being able to customize the code ... just need to find the trigger to manage the element that you are trying to control ... :cool:
Hi there,
Just did what was suggested in that thread, it works great.
I have a question though: I'd rather not touch the code that is not in MY_TEMPLATE.
Is there any suggestion to be able to do the same thing as changing into modules/incription.php (example given) but to keep this change in MY_TEMPLATE?
I've modified the tpl_information.php with the if statement suggested here , but the header of "information" still appears. (which is logical). Anyway to pick up whatever sidebox you want for different pages/ categories without touching the core code?
THanks!
cristele
Copy the file and place it within your template folder beneath modules/.
Use:
modules/MY_TEMPLATE/incription.php
Then you can modify that code without worrying about messing up the core file.
Keep in mind that whereever you see a classic folder, you can place your own folder with the same name as MY_TEMPLATE to override the core files, without modifying core files.
The file should be located in /includes/modules/MY_TEMPLATE/[somefile.php]
This file will override the default file located in /includes/modules
Keep in mind that whereever you see a classic folder, you can place your own folder with the same name as MY_TEMPLATE to override the core files, without modifying core files.
That's very cool....works like a charm:cool:
This is the coolest feature about ZenCart!
It's a fantastic template override system.
It's important that you don't modify core files.. you should always use template override. Just create a folder in the appropriate directory called MY_TEMPLATE (use the real name of your template) and copy the default files into it. You can modify those files. If you screw it up royally, you can remove your override file, and the cart will use the defualt files again.
See this link for some more info, and try some other searches in the tutorials or wiki
https://www.zen-cart.com/tutorials/index.php?article=36
I have really tried to follow this thread, copying and pasting and testing and ...... getting nowhere except very frustrated.
I downloaded the blank_sidebox.php. Renamed it to colour_sidebox.php
into the 3 relevant folders as per the instructions.
I am using override of merlin/. on the admin/tools/layout boxes controller I have turned on the sidebox.
It now shows on all pages. However, I do not want it to show on the home page.
What code do I use please and where do I put it.. Polite responses please..
Thank you in anticipation
Bump !
Following on from the above, I have changed my code to the following.
The Colours side box still shows on the main page. Any ideas please..
I have tried changing the false to true, but nothing happens
// test if box should display
$show_colour_sidebox = false;
$this_is_home_page = $($current_page== 'sideboxes');
$show_colour_sidebox = !$this_is_home_page;
if ($show_colour_sidebox == true) {
require($template->get_template_dir('tpl_colour_sidebox.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_colour_sidebox.php');
$title = BOX_HEADING_COLOUR_SIDEBOX;
$title_link = false;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
}
?>