Hi,
I am just wondering if it is possible to show Feature Product Sidebox on other pages but not on the main page? Is there a button where I can simply turn it off? Please let me know. Thanks.
Best regards,
Ethan
Printable View
Hi,
I am just wondering if it is possible to show Feature Product Sidebox on other pages but not on the main page? Is there a button where I can simply turn it off? Please let me know. Thanks.
Best regards,
Ethan
You can customize the side box to disable when the variable:
$this_is_home_page
is true ...
Hi Ajeh,
Thanks for your quick response. Where do I find the variable $this_is_home_page? I got no luck using the Developers Tool Kit. Please let me know. Thanks again.
Best regards,
Ethan
Sorry this was new in v1.3.5 ... and updated in v1.3.6 ...
I just realized you are v1.2.7 ...
You can download a v1.3.6 and see how this is done to cover all the possible settings for determining a true home page ...
It will be something like this that you could use:
PHP Code:
$this_is_home_page = ($current_page=='index' && (!isset($_GET['cPath'])) && (!isset($_GET['manufacturers_id'])) && (!isset($_GET['typefilter'])) );
Hi Ajeh,
Thanks for your reply. It sounds complicated. Can you provide me with more instructions?
Regards,
Ethan
Add that to the top of the sidebox ...
When $this_is_home_page is true then you do not want to show the sidebox ...
NOTE: this is already built into v1.3.6 and above ... so you will not need it in the sidebox when you upgrade ...
the /includes/modules/sideboxes/featured.php already has in it:
When $show_featured is true the sidebox shows ...Quote:
// test if box should display
$show_featured= true;
NOTE: there is a second check following the select of the featured products for whether or not there is "something" to show ... you only care if you are on the main page, from there the sidebox can run normally ...
So below the
$show_featured = true;
You could add the code:
NOTE: This is written in two lines so that you can find it easily in the future for upgrading ...PHP Code:
$this_is_home_page = ($current_page=='index' && (!isset($_GET['cPath'])) && (!isset($_GET['manufacturers_id'])) && (!isset($_GET['typefilter'])) );
$show_featured = $this_is_home_page;
What this will do is turn on/off the featured sidebox based on if you are on the home page or not ...
Hi Ajeh,
I took your suggestion to add the following code under $show_featured= true;
$this_is_home_page = ($current_page=='index' && (!isset($_GET['cPath'])) && (!isset($_GET['manufacturers_id'])) && (!isset($_GET['typefilter'])) );
$show_featured = $this_is_home_page;
However, the Featured Product Sidebox still shows up on the homepage. What did I miss?
Regards,
Ethan
You just set $show_featured to true on the main page ... so it shows ... :eek:
You need it the other way ...
Now when the it is the main page, this is false and when not the main page it is true ...PHP Code:
$show_featured = !$this_is_home_page;
When false it is skipped and when true it runs ...
Got all that? :lamo:
Hi Ajeh,
Thanks for getting back to me. Sorry, I am afraid I need more help as I am not familar with php code. There are two $show_featured, which one did you refer to? Do you mean to change this code from:
$show_featured= true;
$this_is_home_page = ($current_page=='index' && (!isset($_GET['cPath'])) && (!isset($_GET['manufacturers_id'])) && (!isset($_GET['typefilter'])) );
$show_featured = $this_is_home_page;
to this code:
$show_featured= false;
$this_is_home_page = ($current_page=='index' && (!isset($_GET['cPath'])) && (!isset($_GET['manufacturers_id'])) && (!isset($_GET['typefilter'])) );
$show_featured = $this_is_home_page;
OR to this code:
$show_featured= !$this_is_home_page;
$this_is_home_page = ($current_page=='index' && (!isset($_GET['cPath'])) && (!isset($_GET['manufacturers_id'])) && (!isset($_GET['typefilter'])) );
$show_featured = $this_is_home_page;
I try all these and none of them work. Please help. Thanks again.
Best regards,
Ethan
You are setting $show_featured to false ...PHP Code:
$show_featured= false;
$this_is_home_page = ($current_page=='index' && (!isset($_GET['cPath'])) && (!isset($_GET['manufacturers_id'])) && (!isset($_GET['typefilter'])) );
$show_featured = $this_is_home_page;
Then you setting the main page value to $this_is_home_page ...
Then you are setting the results to $show_featured but you want the opposite result ...
When main page do not show, as in: !$this_is_home_page meaning if I am the home page, don't show, so I need to be false ... !true is false ...
So the results would be:
PHP Code:
if (true) {
// show box
}