Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Hybrid View

  1. #1
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: Specific sideboxe to show on specific page only

    CSS may be easier...

    If you want the sidebox to be hidden on ALL pages EXCEPT one specific page, then you create a declaration in the main stylesheet that says:

    #mySidebox {display:none;}

    Then you create a PAGE-SPECIFIC stylesheet (for whatever page you want that sidebox on) and change the declaration to:

    #mySidebox {display:block;}

    Look at the stylesheet README file in the main CSS folder (probably classic/css) for instructions on creating page-specific stylesheets.

    SEE IT IN ACTION (sort of)...

    GRAPHIC SIDEBOX is ON

    GRAPHIC SIDEBOX is OFF
    20 years a Zencart User

  2. #2
    Join Date
    Apr 2011
    Posts
    584
    Plugin Contributions
    0

    Default Re: Specific sideboxe to show on specific page only

    Quote Originally Posted by schoolboy View Post
    CSS may be easier...

    If you want the sidebox to be hidden on ALL pages EXCEPT one specific page, then you create a declaration in the main stylesheet that says:

    #mySidebox {display:none;}

    Then you create a PAGE-SPECIFIC stylesheet (for whatever page you want that sidebox on) and change the declaration to:

    #mySidebox {display:block;}

    Look at the stylesheet README file in the main CSS folder (probably classic/css) for instructions on creating page-specific stylesheets.

    SEE IT IN ACTION (sort of)...

    GRAPHIC SIDEBOX is ON

    GRAPHIC SIDEBOX is OFF

    I dont think CSS would work in my case. I planning on adding 5 specific sideboxe to 5 unique page so it would prob increase page load time.

  3. #3
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: Specific sideboxe to show on specific page only

    Quote Originally Posted by nicksab View Post
    so it would prob increase page load time.
    The additional CSS is a single declaration... Maybe increases page load time by seven-trillionths of a second...
    20 years a Zencart User

  4. #4
    Join Date
    Apr 2011
    Posts
    584
    Plugin Contributions
    0

    Default Re: Specific sideboxe to show on specific page only

    Quote Originally Posted by schoolboy View Post
    The additional CSS is a single declaration... Maybe increases page load time by seven-trillionths of a second...
    I created a page specific stylesheet called san_rafael.css with the folowing inside of it:

    /**
    * Main CSS Stylesheet
    *
    * @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: san_rafael.css 5952 2007-03-03 06:18:46Z drbyte $
    */

    #blanksidebox {display:block;}

    Then I added #blanksidebox {display:none;} to stylesheet.css


    When I go to the main page, the sidebox is not showing but it is not showing on the other page either

    I must be missing something or did something wrong.

    Could you please help me?

    Thank you

  5. #5
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,303
    Plugin Contributions
    1

    Default Re: Specific sideboxe to show on specific page only

    I've done a lot of sidebox 'placement' on a website - maybe I can be of some use.

    While I haven't needed to have a sidebox on one page only I have had a sidebox appear on all pages except one, so the code should be able to be switched.

    Is your page a 'define page'? i.e. is there a folder for it in /includes/modules/pages ? if so what is its name?

  6. #6
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: Specific sideboxe to show on specific page only

    I still maintain the URL rewriter is an issue here... but even so, that's your choice:

    Look here: http://www.zen-cart.com/showthread.php?44364
    20 years a Zencart User

  7. #7
    Join Date
    Apr 2011
    Posts
    584
    Plugin Contributions
    0

    Default Re: Specific sideboxe to show on specific page only

    Quote Originally Posted by schoolboy View Post
    I still maintain the URL rewriter is an issue here... but even so, that's your choice:

    Look here: http://www.zen-cart.com/showthread.php?44364
    I tried it with the rewritter off so the actual page id shows up but I have the same problem with the sideboxe

    Hidden everywhere even with the page specific .css

  8. #8
    Join Date
    Apr 2011
    Posts
    584
    Plugin Contributions
    0

    Default Re: Specific sideboxe to show on specific page only

    Quote Originally Posted by simon1066 View Post
    I've done a lot of sidebox 'placement' on a website - maybe I can be of some use.

    While I haven't needed to have a sidebox on one page only I have had a sidebox appear on all pages except one, so the code should be able to be switched.

    Is your page a 'define page'? i.e. is there a folder for it in /includes/modules/pages ? if so what is its name?
    Yes the page was created on the about_us page mod so it is a define page. there is a folder for it in .../includes/modules/pages.

    The name of the folder is san_rafael and the folder contains the header.php file for this specific page.

    Thank you for your help on this issue

  9. #9
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,303
    Plugin Contributions
    1

    Default Re: Specific sideboxe to show on specific page only

    Quote Originally Posted by nicksab View Post
    Yes the page was created on the about_us page mod so it is a define page. there is a folder for it in .../includes/modules/pages.

    The name of the folder is san_rafael and the folder contains the header.php file for this specific page.

    Thank you for your help on this issue
    The code I use if I want to have blank_sidebox NOT appear on san_rafael page is:

    if (in_array($current_page_base,explode(",",'san_rafael')) ) {
    $$show_static_blank_sidebox = false;
    } else {
    $show_static_blank_sidebox = true;
    }

    So I think that to have this sidebox ONLY appear on san_rafael page I would replace your code in modules/sideboxes/blank_sidebox.php:

    // test if box should display
    $show_blank_sidebox = true;

    if (in_array($_GET['main_page'], array(FILENAME_SAN_RAFAEL))) {
    $show_blank_sidebox = true
    } else
    $show_blank_sidebox = false

    with:

    // test if box should display

    if (in_array($current_page_base,explode(",",'san_rafael')) ) {
    $$show_static_blank_sidebox = true;
    } else {
    $show_static_blank_sidebox = false;
    }

    It shouldn't matter that the url for san_rafael has been rewritten, I use rewrites (CEON mapping) and don't seem to have an issue.

    As I type I notice that your code seems to be missing some brackets:

    if (in_array($_GET['main_page'], array(FILENAME_SAN_RAFAEL))) {
    $show_blank_sidebox = true
    } else {
    $show_blank_sidebox = false
    }

    Perhaps that was the problem?

    Hope it works.

  10. #10
    Join Date
    Apr 2011
    Posts
    584
    Plugin Contributions
    0

    Default Re: Specific sideboxe to show on specific page only

    If I use this code

    if (in_array($current_page_base,explode(",",'san_rafael')) ){
    $$show_blank_sidebox = false;
    } else {
    $show_blank_sidebox = true;
    }


    if ($show_blank_sidebox == true) {
    require($template->get_template_dir('tpl_blank_sidebox.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_blank_sidebox.php');
    $title = BOX_HEADING_BLANK_SIDEBOX;
    $title_link = false;
    require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
    }
    ?>

    The sideboxe shows everywhere except on san_rafael.

    If I change the code to

    if (in_array($current_page_base,explode(",",'san_rafael')) ){
    $$show_blank_sidebox = true;
    } else {
    $show_blank_sidebox = false;
    }


    if ($show_blank_sidebox == true) {
    require($template->get_template_dir('tpl_blank_sidebox.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_blank_sidebox.php');
    $title = BOX_HEADING_BLANK_SIDEBOX;
    $title_link = false;
    require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
    }
    ?>

    It does not show anywhere.

    What am I missing here??

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v151 Show payment for only specific group pricing customers
    By dionidis in forum Addon Payment Modules
    Replies: 1
    Last Post: 12 Dec 2012, 02:55 PM
  2. Only Show/Offer Item if Specific Dollar Amount is Purchased?
    By Rick5150 in forum Managing Customers and Orders
    Replies: 1
    Last Post: 20 Jul 2012, 08:25 PM
  3. Hide Categories and show only for specific groups
    By gazag in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 5 Dec 2011, 08:28 PM
  4. specific banner to show for specific category
    By vijay in forum Basic Configuration
    Replies: 1
    Last Post: 26 Aug 2009, 01:19 PM
  5. Adding specific sideboxe for EZ pages
    By keygrip in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 20 Dec 2006, 06:15 AM

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