Re: Not to show Featured Product Sidebox on main page
If I were to do this to the Featured sidebox ... I would copy the code to the proper templates and overrides and edit the file to change:
PHP Code:
// test if box should display
$show_featured= true;
To read:
PHP Code:
// test if box should display
// $show_featured= true;
$show_featured = !$this_is_home_page;
Now the condition is based on the existing $this_is_home_page and only shows when false or !$this_is_home_page
So more or less you are using:
PHP Code:
// test if box should display
$show_colour_sidebox = false;
$this_is_home_page = $($current_page== 'sideboxes');
$show_colour_sidebox = !$this_is_home_page;
And should be using:
PHP Code:
// test if box should display
// $show_colour_sidebox = false;
$show_colour_sidebox = !$this_is_home_page;
Note: commenting out the:
PHP Code:
// $show_colour_sidebox = false;
is just to eliminate confusion ... whether or not it is commented out is is reset by the next line:
PHP Code:
$show_colour_sidebox = !$this_is_home_page;
Easy smeasy, eh? :cool:
Re: Not to show Featured Product Sidebox on main page
Hi Linda
I wish it was so easy.
This is the code I now have.
// test if box should display
$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);
}
?>
this code resides in ..includes\modules\MY_TEMPLATE_NAME\colour_sidebox.php
Unfortunately the colour side box still shows on the main page.
This is the only colour_sidebox.php file that I have on the system. So I must be missing something else.
thank you for your prompt reply..
I will get the hang of this.......
Re: Not to show Featured Product Sidebox on main page
Add this just before the IF statement in your sidebox:
PHP Code:
echo 'I SEE ' . ($this_is_home_page == true ? "Lucy I'm Home!" : "Rick? Where are you");
Then look where you should see the sidebox and tell me what it reads ... :smile:
Re: Not to show Featured Product Sidebox on main page
Hi I have added the code as suggested and all I get is the side box
no other description...
Re: Not to show Featured Product Sidebox on main page
Re: Not to show Featured Product Sidebox on main page
Have you an URL to your site and do you have the sidebox currently show on your site?
And your code looks like what now?
Re: Not to show Featured Product Sidebox on main page
Hi Linda
Sorry. I am working on localhost, building the site, as I am already live with a HTML site at www.merlinmounts.co.uk...
I know this is not the ideal solution, but I am sure you are aware it is the easiest option. - until that is.. one gets problems...
This is my code that I have in...
store\includes\modules\merlin\colour_sidebox.php.
merlin is my override folder..
Basically I downloaded the Blank_sidebox 2 from the site. Changed all occurences of blank_sidebox to my own name of colour_sidebox in the 3 override folders.
// test if box should display
// $show_colour_sidebox = false;
// $this_is_home_page = $($current_page== 'sideboxes');
$show_colour_sidebox = !$this_is_home_page;
echo 'I SEE ' . ($this_is_home_page == true ? "Lucy I'm Home!" : "Rick? Where are you");
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);
}
?>
Re: Not to show Featured Product Sidebox on main page
To help me understand. could you please explain briefly where the term
$this_is_home_page
comes from. Is it an actual name of a page?
Re: Not to show Featured Product Sidebox on main page
Sorry to add to the above.
Is it the same as $this_is_main_page.php
Re: Not to show Featured Product Sidebox on main page
$this_is_home_page is a variable set when the main page is resolved to the actual "home" page of your site to distinguish between all of the other pages ...
You can find where it is set by going to the Developers Tool Kit in your Admin under the Tools menu ...
Enter it in the bottom input box and select Catalog/Admin and click search ...
You will see where there is a:
$this_is_home_page = blah blah blah
Now, if you do not find this ... then you have files out of date from an upgrade issue ...
I am really surprised that you are not seeing Lucy or Ricky on this as one or the other should be showing ...
Are you sure you are editing the right file?