Results 1 to 10 of 189

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Posts
    745
    Plugin Contributions
    4

    Default Show/Hide sideboxes based on page

    Not sure if anyone has written anything along these lines and a search didn't seem to turn up anything...

    My company has a need to have a contribution that permits selectively showing/hiding sideboxes based on the particular page ZC is rendering. Perhaps, by programatically selecting a different layout based on the page requested. I was considering writing such a contrib but don't want to re-invent the wheel if it has already been done...

    Anyone have any info on such a contrib?

    Thank you very much!

    Jeff

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Show/Hide sideboxes based on page

    A straightforward way of achieving this is to use page-based stylesheets to determine which pages do or do not display certain sideboxes. For example, if you only wanted the shopping cart to appear on the contact_us page (deliberately silly example) then you would set the shopping cart sidebox to be on in Admin but include the following in your stylesheet
    #shoppingcart {display:none}
    You would then create a css file called contact_us.css that contains only the line
    shoppingcart {display:block}
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    Nov 2004
    Location
    Deal, Kent, UK
    Posts
    332
    Plugin Contributions
    0

    Default Re: Show/Hide sideboxes based on page

    That is very clever - often wondered about how to do it but never bothered to investigate - thanks for the tip!

  4. #4
    Join Date
    Sep 2004
    Posts
    745
    Plugin Contributions
    4

    Default Re: Show/Hide sideboxes based on page

    Thank you kuroi for your suggestion!! I will have to play with this a while to see if it will do the trick but other than efficiency (due to the fact that the sidboxes are still being processed) it is still a very clever way!

    Again, thanks!

    Jeff

  5. #5
    Join Date
    Apr 2006
    Location
    Columbus, OH
    Posts
    99
    Plugin Contributions
    0

    Default Re: Show/Hide sideboxes based on page

    I was just forwarded this thread because I have a similar situation. How would this technique work with specific product pages? More specifically, the cart generates a list of numbers to determine the product pages (at least in the URL window). How would I attach the css file for a product category, for example, books?

  6. #6
    Join Date
    Sep 2004
    Posts
    745
    Plugin Contributions
    4

    Default Re: Show/Hide sideboxes based on page

    Take a look at the top of common/tpl_main_page.php where you can specify a list of comma delimited page names to hide sideboxes on. This may be a better solution than css for your purpose.

    Jeff

  7. #7
    Join Date
    Sep 2010
    Posts
    612
    Plugin Contributions
    0

    Default Re: Show/Hide sideboxes based on page

    How do I hide the Reviews sidebox when on a product page? Thank you!

  8. #8
    Join Date
    Sep 2010
    Posts
    612
    Plugin Contributions
    0

    Default Re: Show/Hide sideboxes based on page

    Nevermind.

    Found the answer in FAQ.

 

 

Similar Threads

  1. v150 Any way to show/hide payment modules dynamically based on order total?
    By Limitless in forum Addon Payment Modules
    Replies: 2
    Last Post: 27 Sep 2012, 03:22 PM
  2. Show/Hide INformation Sidebox based on page
    By atracksler in forum Basic Configuration
    Replies: 12
    Last Post: 17 Jun 2011, 04:21 PM
  3. Show/Hide sideboxes based on page
    By monkeyjr47906 in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 29 Nov 2007, 07:25 PM
  4. Hide sideboxes on main page
    By disciple in forum Templates, Stylesheets, Page Layout
    Replies: 18
    Last Post: 11 Jan 2007, 07:38 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