Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Jan 2009
    Posts
    2,124
    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,860
    Plugin Contributions
    2

    Default Re: Additional Sidebox Only to Appear in current_category_id

    Dezina ZenCart Templates
    Please do not PM for support queries..Post in forums..help others

  3. #3
    Join Date
    Sep 2004
    Location
    Western Massachusetts
    Posts
    2,944
    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,124
    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,124
    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,124
    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,124
    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
    Join Date
    Feb 2009
    Location
    Orlando, Fl
    Posts
    5
    Plugin Contributions
    0

    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')

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

    Default Re: Additional Sidebox Only to Appear in current_category_id

    Quote Originally Posted by Aetherlux View Post
    IF ($current_category_id=='8' or $current_category_id=='9')
    Incorrect marked red...should be
    Code:
    if ($current_category_id == 8 or $current_category_id == 9 ... etc. etc.
    Dezina ZenCart Templates
    Please do not PM for support queries..Post in forums..help others

  10. #10
    Join Date
    Feb 2009
    Location
    Orlando, Fl
    Posts
    5
    Plugin Contributions
    0

    Default Re: Additional Sidebox Only to Appear in current_category_id

    thanks. still learning

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. how to add an additional sidebox in v1.x.x
    By mediathing in forum Addon Sideboxes
    Replies: 42
    Last Post: 15 Dec 2011, 11:41 AM
  2. Additional specials in sidebox
    By greenskeleton in forum Basic Configuration
    Replies: 2
    Last Post: 27 Apr 2010, 02:43 PM
  3. Add additional sidebox banners
    By hockley in forum Basic Configuration
    Replies: 2
    Last Post: 19 Jan 2009, 05:25 PM
  4. Add An Additional Sidebox
    By CarolinaReefs in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 14 Aug 2006, 07:28 AM

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
  •