Forums / Basic Configuration / I need to have a particular sidebox only show on one EZ page.

I need to have a particular sidebox only show on one EZ page.

Locked

Started by tolefairy on 20 Jan 2008, 6:28 AM · Views: 2,435

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
20 Jan 2008, 6:28 AM
#1
tolefairy avatar

tolefairy

Zen Follower

Join Date:
Feb 2007
Location:
West Texas
Posts:
122
Plugin Contributions:
0

I need to have a particular sidebox only show on one EZ page.

I need to have a particular sidebox only show on one EZ page.

main_page=page&id=25&chapter=0

This is what I came up with by searching the forum, but when I use this code I get a parse error. :no:
Could someone tell me where I've gone wrong?

Here's the current code for the includes/modules/sideboxes/mytemplate/partyplanning_links.php that I have.

if ($request_type == 'NONSSL')
if (in_array($current_page_base,explode(",",'main_page=page&id=25&chapter=0')) ) {
     $show_partyplanning_sidebox = true;
  } else {
    $show_partyplanning_sidebox = false;
  }
  
  if ($show_partyplanning_sidebox == true) {
MAIN BLOCK
}  

{

    require($template->get_template_dir('tpl_partyplanning_links.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_partyplanning_links.php');

    $title = BOX_HEADING_PARTYPLANNING_LINKS;
    $left_corner = false;
    $right_corner = false;
    $right_arrow = false;
    $title_link = false;

    require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);

  }

?>
20 Jan 2008, 8:30 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: I need to have a particular sidebox only show on one EZ page.

You might peek in the Downloads for the TOC sidebox for EZ-Pages ...

This only shows when you are using the Chapters on an EZ-Page rather than show the TOC in the middle of the page ...

See if that can get you started on this or if that is all you are needing ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

20 Jan 2008, 10:20 PM
#3
tolefairy avatar

tolefairy

Zen Follower

Join Date:
Feb 2007
Location:
West Texas
Posts:
122
Plugin Contributions:
0

Re: I need to have a particular sidebox only show on one EZ page.

I'm not at all familiar with TOC. Wouldn't that mod let the sidebox show on every EZ page that I have that is =0 (chapter)?? I have about 30 EZ pages with the =0.

I really just need the "if" statement that will only allow ONE particular sidebox to show on ONE particular EZ page. This is my first try at EZ pages and it automatically put the =0 on there.

Hoping you can help me with the "if" statement, in the meantime I'll keep searching for the answer.

many thanks for your help and suggestion.

20 Jan 2008, 11:02 PM
#4
tolefairy avatar

tolefairy

Zen Follower

Join Date:
Feb 2007
Location:
West Texas
Posts:
122
Plugin Contributions:
0

Re: I need to have a particular sidebox only show on one EZ page.

Parse error is this:

Parse error: syntax error, unexpected T_STRING in /home2/shabecom/public_html/includes/modules/sideboxes/Custom1/partyplanning_links.php on line 21

code is this:

<?php
/**
 * absolute links sidebox - displays sidebox with absolute links on all pages EXCEPT SSL pages
 *
 * @package templateSystem
 * @copyright Copyright 2003-2007 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: absolute_links.php 2007-07-09 06:06:06Z  tolefairy $
 *
 * Displays on non ssl pages only-to avoid secure/non-secure warning
 */

if (in_array($current_page_base,explode(",",'main_page=page&id=25&chapter=0')) ) {
     $show_partyplanning_sidebox = true;
  } else {
    $show_partyplanning_sidebox = false;
  }
  
  if ($show_partyplanning_sidebox == true) {
MAIN BLOCK
} 
 
{

    require($template->get_template_dir('tpl_partyplanning_links.php',DIR_WS_TEMPLATE, 

$current_page_base,'sideboxes'). '/tpl_partyplanning_links.php');

    $title = BOX_HEADING_PARTYPLANNING_LINKS;
    $left_corner = false;
    $right_corner = false;
    $right_arrow = false;
    $title_link = false;

    require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, 

$current_page_base,'common') . '/' . $column_box_default);

  }

?>

I'm not using TOC. Just EZ pages.

20 Jan 2008, 11:15 PM
#5
tolefairy avatar

tolefairy

Zen Follower

Join Date:
Feb 2007
Location:
West Texas
Posts:
122
Plugin Contributions:
0

Re: I need to have a particular sidebox only show on one EZ page.

on second thought, I think I'm mixing two problems here. Forgive me.

I'll be back to let you know if I was successful with the Blank Sidebox mod.

20 Jan 2008, 11:20 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: I need to have a particular sidebox only show on one EZ page.

The $current_page_base is 'page' ...

if ($current_page_base== 'page' and $_GET['id']==25 and $_GET['chapter']==0 ) {

Should identify you are on that page ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

21 Jan 2008, 2:20 AM
#7
tolefairy avatar

tolefairy

Zen Follower

Join Date:
Feb 2007
Location:
West Texas
Posts:
122
Plugin Contributions:
0

Re: I need to have a particular sidebox only show on one EZ page.

after two days of trying this-that-and whatever code, trying blank and editable sideboxes, searching til I'm blind and butting my head against the wall, I have come to the conclusion that it cannot be done in zen cart.

if anyone ever finds a way, and is willing to provide the code, the complete code, not just snippets and bits and pieces, to have a sidebox show ONLY on One particular ez page I'm all ears. I am so inexperienced it does me no good for someone to give me a line of code and not clarify exactly where to apply it. I am dumber than dirt about php.

In the meantime, I'm going to build what I need in html. At least I know what I'm doing with that. What I need on my ez pages does not involve the database, so its not a big deal. I would just rather have found a way to do it in zen cart.

Thank you very much for trying to help. But I think I am hopeless in my quest.

21 Jan 2008, 7:22 AM
#8
tolefairy avatar

tolefairy

Zen Follower

Join Date:
Feb 2007
Location:
West Texas
Posts:
122
Plugin Contributions:
0

Re: I need to have a particular sidebox only show on one EZ page.

:clap:It can be done after all, and Ajeh gave me the clue, of course. (thank you, I couldn't have done it without you). It's just very hard to put the clue with the right code when you don't know what you're doing or even where to find it. Zen Cart is not for the faint of heart. After all, it only took me 2 and a half days to get the result. GEEZ!

And for anyone that wants to know how to have a sidebox display on only one ez page its in the modules/sideboxes/Your_Template/???_sidebox.php

??? = whatever you name your sidebox

I used the blank_sidebox mod and gave it the name of partyplanning_sidebox. Mine works on only one particular EZ page and does not show on any other pages on my site. Just like I wanted......finally.

If anyone is wondering why I want a particular sidebox to show on only one page, its because I want the ad that goes in that box to relate to that page only. This way I can duplicate the sidebox, giving each a different name and put relevant ads on relevant pages.

Heres the code that worked for me although Its late and won't be showing until tomorrow. I'm getting some shuteye and will start fresh tomorrow.

// test if box should display
  if ($current_page_base== 'page' and $_GET['id']==25 and $_GET['chapter']==0 ) {  
     $show_partyplanning_sidebox = true;
  } else {
    $show_partyplanning_sidebox = false;
  }

  if ($show_partyplanning_sidebox == true) {
      require($template->get_template_dir('tpl_partyplanning_sidebox.php',DIR_WS_TEMPLATE, 

$current_page_base,'sideboxes'). '/tpl_partyplanning_sidebox.php');
      $title =  BOX_HEADING_PARTYPLANNING_SIDEBOX;
      $title_link = false;
      $left_corner = false;
      $right_corner = false;
      $right_arrow = false;
      require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, 

$current_page_base,'common') . '/' . $column_box_default);
 }
?>

cheers!