Results 1 to 10 of 12

Hybrid View

  1. #1
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Additional Sidebox Only to Appear in current_category_id

    If anyone could help me solve this then it'd be a real help. I'm struggling with a rather complex navigation system which I wont bore you with, but basically I'm planning to add an additional sidebox for each main category which must only appear when the category ID is the one specific to the box contents.

    For Example, when someone clicks on the Lingerie category (http://www.dystynction.com/index.php...ndex&cPath=1_8) then I want the additional sidebox I created to appear.

    I don't want this sidebox visible in any other category.

    The existing contents of the relevant sidebox.php is this:

    PHP Code:
      $show_lingerie_sizes_sidebox true;
      
      if (
    $show_lingerie_sizes_sidebox == true) {
          require(
    $template->get_template_dir('tpl_lingerie_sizes_sidebox.php',DIR_WS_TEMPLATE$current_page_base,'sideboxes'). '/tpl_lingerie_sizes_sidebox.php');
          
    $title =  BOX_HEADING_LINGERIE_SIZES_SIDEBOX;
          
    $title_link false;
          require(
    $template->get_template_dir($column_box_defaultDIR_WS_TEMPLATE$current_page_base,'common') . '/' $column_box_default);
     }
     

     
    ?> 
    I have read from another thread that I might be able to add something like this:


    PHP Code:
     IF ($current_category_id=='1_8') {
      
    $show_lingerie_sizes_sidebox == true;
    } else {
      
    $show_lingerie_sizes_sidebox == false;

    ..........but when I try to add this it just doesn't work...

    Can anyone please help me write this little piece of code? Thanks so much to anyone who can help me :-)

  2. #2
    Join Date
    Apr 2004
    Location
    UK
    Posts
    5,821
    Plugin Contributions
    2

    Default Re: Additional Sidebox Only to Appear in current_category_id


  3. #3
    Join Date
    Sep 2004
    Location
    Western Massachusetts
    Posts
    2,945
    Plugin Contributions
    5

    Default Re: Additional Sidebox Only to Appear in current_category_id

    the current_category_id is not 1_8, but just 8 (the actual category id number).
    Neville
    An assumption is what you arrive at when you get tired of thinking...

  4. #4
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: Additional Sidebox Only to Appear in current_category_id

    Hi guys,

    thanks for replying, it's really appreciated.

    I looked at the other thread and I tried to plug in the IF and GET statements but I can't get it to work :-(

    I'm a total amateur with PHP code and this is my first website (you've probably guessed) and was just wondering if any of you guys knew how to 'shoogle' this code to make it work?

  5. #5
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: Additional Sidebox Only to Appear in current_category_id

    Quote Originally Posted by bunyip View Post
    the current_category_id is not 1_8, but just 8 (the actual category id number).
    Thanks for pointing that out Neville, but still can't get it to work :-(

  6. #6
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: Additional Sidebox Only to Appear in current_category_id

    This is how I've tried to edit the PHP:

    PHP Code:
      $show_lingerie_sizes_sidebox true;


      if (
    $_GET['cPath'] == or $_GET['cPath'] == 9) {
          require(
    $template->get_template_dir('tpl_lingerie_sizes_sidebox.php',DIR_WS_TEMPLATE$current_page_base,'sideboxes'). '/tpl_lingerie_sizes_sidebox.php');
          
    $title =  BOX_HEADING_LINGERIE_SIZES_SIDEBOX;
          
    $title_link false;
          require(
    $template->get_template_dir($column_box_defaultDIR_WS_TEMPLATE$current_page_base,'common') . '/' $column_box_default);
          } else {
      
    $show_lingerie_sizes_sidebox == false;
     } 
    Which results in the box not showing at all.

    By the way, I don't get the logic of the category reference numbers.... if http://www.dystynction.com/index.php...ndex&cPath=1_8 is category_id == 8 ............ then what is http://www.dystynction.com/index.php...ex&cPath=1_8_9 ??? is it category_id == 9 ??
    Last edited by limelites; 20 Feb 2009 at 09:08 PM.

  7. #7
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: Additional Sidebox Only to Appear in current_category_id

    If anyone reads this and wonders about a solution then please view this thread as i's been solved there thanks to the wonderful Ajeh

  8. #8
    Aetherlux Guest

    Default Re: Additional Sidebox Only to Appear in current_category_id

    Ok, so you need to swap your first example and your last.

    Lets assume cpath = 6_16_1

    $_GET['cPath'] will give you the category path, ie 6_16_1
    current_category_id will give you the deepest nested cat id ie 1

    so for your example you should use either:


    if ($_GET['cPath'] == 1_8 or $_GET['cPath'] == 1_9)

    or

    IF ($current_category_id=='8' or $current_category_id=='9')

 

 

Similar Threads

  1. Need sidebox to appear on 1 page only
    By Sevenhelmets in forum Basic Configuration
    Replies: 1
    Last Post: 7 Mar 2010, 01:23 PM
  2. i made a sidebox but the sidebox dont appear on my store
    By antonio_Portugal in forum General Questions
    Replies: 1
    Last Post: 21 Jul 2009, 04:51 AM
  3. Adding additional sidebox to one category only?
    By Dunk in forum General Questions
    Replies: 6
    Last Post: 21 Feb 2009, 11:04 AM
  4. EZ Pages sidebox appear in only specific category id's?
    By HTsean in forum General Questions
    Replies: 1
    Last Post: 14 May 2008, 03:19 PM
  5. More Information Sidebox to appear only when logged in
    By mathgyrl in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 10 Jan 2008, 08:25 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR