Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2009
    Location
    Sarajevo
    Posts
    80
    Plugin Contributions
    0

    Default How to show sidebox "News Box Manager" only for certain menu item?

    Hi,

    I have just successfully installed News Box Manager which works OK on my website but problem is that news box sidebox is shown on each page and menu item on my website.
    My web site main navigation look like this:

    --------------------------------------------------------
    HOME | ABOUT US | SHOP | CONTACT |
    --------------------------------------------------------

    and I would like for news box sidebox to be shown for example only where cPath=146 (which is equal to = menu item SHOP).

    I have followed and read this thread but I still couldn't figure out how to solve this

    Any help is appreciated and thanks in advance for promt replys!

    Cheers
    Adi
    MY Website
    The best of the best: Zen Cart

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: How to show sidebox "News Box Manager" only for certain menu item?

    Similar to post 14 in that thread, you could add this to your review.php or tpl_review.php file
    PHP Code:
      $show_reviewfalse;

      if (
    $_GET['cPath'] == '146') {
        
    $show_review true;
      }

      if (
    $show_review == true) {

        
    //sidebox code

      

    This would show the sidebox on that category and all products in it. If it has subcategories, you would want the line to be
    PHP Code:
      if ( (int)$_GET['cPath'] == '146') { 

  3. #3
    Join Date
    Dec 2009
    Location
    Sarajevo
    Posts
    80
    Plugin Contributions
    0

    Default Re: How to show sidebox "News Box Manager" only for certain menu item?

    It's working great , thnx a lot Glenn for your quick and precise answer/help as always, truly appreciate it

    In case someone would had same problem like me this is how I sloved it:

    news_scroll_box.php code

    Code:
    <?php
    //
    // +----------------------------------------------------------------------+
    // |zen-cart Open Source E-commerce                                       |
    // +----------------------------------------------------------------------+
    // | Copyright (c) 2003 The zen-cart developers                           |
    // |                                                                      |
    // | http://www.zen-cart.com/index.php                                    |
    // |                                                                      |
    // | Portions Copyright (c) 2003 osCommerce                               |
    // +----------------------------------------------------------------------+
    // | This source file is subject to version 2.0 of the GPL license,       |
    // | that is bundled with this package in the file LICENSE, and is        |
    // | available through the world-wide-web at the following url:           |
    // | http://www.zen-cart.com/license/2_0.txt.                             |
    // | If you did not receive a copy of the zen-cart license and are unable |
    // | to obtain it through the world-wide-web, please send a note to       |
    // | [email protected] so we can mail you a copy immediately.          |
    // +----------------------------------------------------------------------+
    // | Do Not Remove: Coded for Zen-Cart by geeks4u.com                     |
    // | Dedicated to Memory of Amelita "Emmy" Abordo Gelarderes		  |
    // +----------------------------------------------------------------------+
    // $Id: news_scroll_box.php,v 1.2 2004/08/26
    //
    
      $show_news_scroll_box= false;
    
      if ($_GET['cPath'] == '148') {
        $show_news_scroll_box= true;
      }
    
      if ($show_news_scroll_box == true) {
    
    $languages_id = zen_db_prepare_input((int)$_SESSION['languages_id']);
    $news_box_query = $db->Execute("select nc.news_title, nc.news_content
    								from " . TABLE_BOX_NEWS_CONTENT . " nc, " . TABLE_BOX_NEWS . " n
    								where n.box_news_id = nc.box_news_id and nc.languages_id = " . $languages_id . " and n.news_status = 1 and now() between n.news_start_date and n.news_end_date");
    while (!$news_box_query->EOF) {
      if(($news_box_query->fields['news_title']) || ($news_box_query->fields['news_content'])){
        require($template->get_template_dir('tpl_news_scroll_box.php', DIR_WS_TEMPLATE, $current_page_base,'sideboxes') . '/tpl_news_scroll_box.php');
    
        $title =  BOX_HEADING_SCROLL_BOX;
        $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);
        break;
      } 
      else{
        $news_box_query->MoveNext();
      }
    }
    }
    ?>
    MY Website
    The best of the best: Zen Cart

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: How to show sidebox "News Box Manager" only for certain menu item?

    Glad it works for you.
    Just as an aside, I notice that this sidebox file has some obsolete code in it that has not been useful for several years:
    Code:
        $title =  BOX_HEADING_SCROLL_BOX;
        $left_corner = false;
        $right_corner = false;
        $right_arrow = false;
        $title_link = false;
    The lines in red can be deleted to streamline the file. The others need to stay.

 

 

Similar Threads

  1. "Specials" sidebox showing only for certain categories?
    By kcb410 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 9 Sep 2012, 01:25 AM
  2. Show "All Products" (Sidebox) Link on Category/Product Pages ONLY?
    By msmith29063 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 30 Nov 2008, 04:46 AM
  3. Show "Units In Stock" for certain product only.
    By laydiefa in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 26 Nov 2008, 08:08 PM
  4. Have "Sale is final" text automatically show up for certain categories?
    By khopek in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 13 Feb 2008, 10:33 PM
  5. Replies: 3
    Last Post: 18 Aug 2007, 06:00 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