Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / EZ pages sidebox exclusion doesn't seem to work

EZ pages sidebox exclusion doesn't seem to work

Locked

Views: 3,204

Results 1 to 20 of 30
This thread is locked. New replies are disabled.
29 Jun 2008, 4:51 AM
#1
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

EZ pages sidebox exclusion doesn't seem to work

I am not sure what I am doing wrong. I followed the instructions from the FAQ section of the Zen Cart site, How can I vary which sideboxes are shown on each of my EZ-Pages?

https://www.zen-cart.com/tutorials/index.php?article=249

I am adding the code to the best sellers section of my site according to the instructions:

require($template->get_template_dir('tpl_best_sellers.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_best_sellers.php');
$title = BOX_HEADING_BESTSELLERS;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);

This is what the code looks like after I added the code:

if (!isset($ez_page_id) || !in_array($ezpage_id,explode(",",'1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18'))) {
require($template->get_template_dir('tpl_best_sellers.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_best_sellers.php');
$title = BOX_HEADING_BESTSELLERS;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
}

I am wondering if I missed something.

29 Jun 2008, 11:26 PM
#2
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

Re: EZ pages sidebox exclusion doesn't seem to work

Has anyone been able to get this feature to work?

30 Jun 2008, 12:39 AM
#3
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: EZ pages sidebox exclusion doesn't seem to work

What is it doing for you? Not showing the sidebox ever, or not hiding it ever?
Can we see where you have it (not) working?

30 Jun 2008, 2:40 AM
#4
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

Re: EZ pages sidebox exclusion doesn't seem to work

I want to remove all the sideboxes from the ez pages pages except one, an editable sidebox I downloaded which I will use to create a link to help related topics. Sort of like Amazon.com. So this new sidebox which I have entitled help topics will only be visible on EZ pages pages.

http://www.cooltechcentral.com/test/index.php?main_page=page&id=16

30 Jun 2008, 3:19 AM
#5
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: EZ pages sidebox exclusion doesn't seem to work

So you're saying that the code is not hiding the sideboxes on ez-pages?
Are you wanting different sideboxes showing on different ez-pages, or the same set on all ez-pages? If you want all ez-pages to work the same, there is no point in the code that allows individual ez-page handling.

30 Jun 2008, 3:34 AM
#6
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

Re: EZ pages sidebox exclusion doesn't seem to work

gjh42:

So you're saying that the code is not hiding the sideboxes on ez-pages?

Yeah, that's what I am saying I haven't activated the specific sidebox that I want to ONLY be visible on EZ pages yet. I want to remove all other sideboxes first.

Are you wanting different sideboxes showing on different ez-pages, or the same set on all ez-pages? If you want all ez-pages to work the same, there is no point in the code that allows individual ez-page handling.

I just want that one sidebox (help topic) to show up on all EZ pages, that sidebox only. First I need to figure out how to remove bestellers, featured, specials, categories, and testimonial before that.

30 Jun 2008, 6:48 AM
#7
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: EZ pages sidebox exclusion doesn't seem to work

For starters, simplify the test:```php
if (!isset($ez_page_id)) {
echo 'not ez-page';//for debugging
require($template->get_template_dir('tpl_best_sellers.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_best_sellers.php');
$title = BOX_HEADING_BESTSELLERS;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
} else {
echo $ez_page_id;//for debugging
}

30 Jun 2008, 11:52 AM
#8
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

Re: EZ pages sidebox exclusion doesn't seem to work

gjh42:

For starters, simplify the test:```php
if (!isset($ez_page_id)) {
echo 'not ez-page';//for debugging
require($template->get_template_dir('tpl_best_sellers.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_best_sellers.php');
$title = BOX_HEADING_BESTSELLERS;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
} else {
echo $ez_page_id;//for debugging
}


No, it didn't work I did see "not ez-page" right above the bestsellers sidebox. I wonder if it's possible to just disable all the sideboxes in EZ pages within the admin section but still have that help topics sidebox show up on all the EZ pages.
30 Jun 2008, 9:20 PM
#9
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

Re: EZ pages sidebox exclusion doesn't seem to work

Anyone have a solution? Maybe I am doing something wrong.

1 Jul 2008, 1:46 AM
#10
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

Re: EZ pages sidebox exclusion doesn't seem to work

Here is another file this time for testimonial manager
I put the file in "include/modules/sideboxes/MY_TEMPLATE"
Used the same codes ( the one from the FAQ as well as the one suggested in this post) but again it didn't work.

<?php /** * Testimonial Manager - sidebox * * @package templateSystem * @copyright Copyright 2003-2005 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: Testimonials_Manager.php v1.4.6 3-26-2008 Clyde Jones $ */ // test if box should display $page_query = $db->Execute("select testimonials_id, testimonials_image, testimonials_title, testimonials_html_text, date_added from " . TABLE_TESTIMONIALS_MANAGER . " where status = 1 and language_id = " . (int)$_SESSION['languages_id'] . " order by rand(), testimonials_title limit " . MAX_DISPLAY_TESTIMONIALS_MANAGER_TITLES .""); if ($page_query->RecordCount()>0) { $title = BOX_HEADING_TESTIMONIALS_MANAGER; $box_id = testimonials_manager; $rows = 0; while (!$page_query->EOF) { $rows++; $page_query_list[$rows]['id'] = $page_query->fields['testimonials_id']; $page_query_list[$rows]['name'] = $page_query->fields['testimonials_title']; $page_query_list[$rows]['story'] = $page_query->fields['testimonials_html_text']; $page_query_list[$rows]['image'] = $page_query->fields['testimonials_image']; $page_query->MoveNext(); } $left_corner = false; $right_corner = false; $right_arrow = false; $title_link = false; require($template->get_template_dir('tpl_testimonials_manager.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_testimonials_manager.php'); require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default); } ?>
1 Jul 2008, 5:27 PM
#11
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: EZ pages sidebox exclusion doesn't seem to work

If you were seeing "not ez-page" even on ez-pages, that indicates that the test
if (!isset($ez_page_id))
is not working correctly.
Maybe the variable $ez_page_id is misspelled in the example?

A check in the Developers Toolkit shows no matches in the ZC files for $ez_page_id, but a bunch for $ezpage_id.

Change $ez_page_id to $ezpage_id and this code should work.

2 Jul 2008, 12:14 PM
#12
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: EZ pages sidebox exclusion doesn't seem to work

gjh42:

Change $ez_page_id to $ezpage_id and this code should work.There was indeed a misspelling in the FAQ, which has now been corrected.

3 Jul 2008, 12:46 AM
#13
barco57 avatar

barco57

Totally Zenned

Join Date:
Apr 2006
Location:
West Salem, IL
Posts:
2,844
Plugin Contributions:
0

Re: EZ pages sidebox exclusion doesn't seem to work

Glenn,
I tried the simplified test code....its a no go. If I use it on the categories sidebox it stops display of all sideboxe, content, footer......If I apply it to the search sidebox then the category sidebox will show but then the rest of the page fails to parse.....

I get the same behavior from the code on the tutorial page

3 Jul 2008, 7:51 AM
#14
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: EZ pages sidebox exclusion doesn't seem to work

That is because the test code (and the tutorial code it was adapted from) contained a misspelled variable name.

It needs to be $ezpage_id, not $ez_page_id.

The problem with this was that it wouldn't hide sideboxes, not that it caused errors. Do you have some setting that will halt execution if a nonexistent variable is called?

4 Jul 2008, 11:32 PM
#15
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

Re: EZ pages sidebox exclusion doesn't seem to work

Thanks for the update. I am wondering if it were possible to have a sidebox ONLY show up on EZ pages generated pages.

5 Jul 2008, 9:59 AM
#16
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

Re: EZ pages sidebox exclusion doesn't seem to work

I know that excluding a sidebox from all other pages except for EZ pages is a little bit more complicated, but I am using the stylesheet to exclude all sideboxes except the one for easy pages is possible using a similar code:

#allDepartmentsMainContent .buttonRow {display: none;}

5 Jul 2008, 2:03 PM
#17
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: EZ pages sidebox exclusion doesn't seem to work

You can easily set any sidebox to display only on ez-pages, by reversing the test code given above, like this:```php
if (isset($ez_page_id)) {
//code to execute on ez-pages
}

5 Jul 2008, 2:12 PM
#18
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: EZ pages sidebox exclusion doesn't seem to work

You can also use CSS to hide a sidebox except where desired:```
#sideboxid {display: none;}

#pageBody #sideboxid {display: block;}

This hides the "sideboxid" box except on ez-pages.
5 Jul 2008, 4:32 PM
#19
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

Re: EZ pages sidebox exclusion doesn't seem to work

gjh42:

You can also use CSS to hide a sidebox except where desired:```
#sideboxid {display: none;}

#pageBody #sideboxid {display: block;}

> This hides the "sideboxid" box except on ez-pages.

I know this is a rhetorical question but you add the sidebox id to the code above code?
5 Jul 2008, 4:35 PM
#20
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: EZ pages sidebox exclusion doesn't seem to work

All CSS code goes in your stylesheet (/includes/templates/your_template/css/stylesheet.css).

Replace sideboxid with the name of your sidebox; this can be found in View Source, by looking at the <div id="sideboxid"> above the sidebox output.