Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2009
    Posts
    23
    Plugin Contributions
    0

    Default Control Sidebox Display Based on Category

    Hi
    I would like to control some of my sideboxes and only have them display on certain categories. It is important they display on the main category page and also on the product page for that category.
    It is also important for the sidebox to display when a search is done on a manufacturer, so if the product is in a category that has the sidebox set to display, it shows up even if the search has been done on manufacturer.

    For example:
    I have categories of clothes ie jumpers, trousers, t-shirts etc.
    I need to show a specific sidebox when a visitor is on a page for the category jumper but a different sidebox when on a page for the category trousers.
    The sidebox needs to be displayed on the main jumper page, as well as on all the jumper's individual product pages - this is to ensure that if a search is made that doesn't include the word jumper, the correct sidebox displays.

    The product page ids are being numerically generated.

    Many thanks.

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

    Default Re: Control Sidebox Display Based on Category

    You can use category-specific stylesheets for this.

    Each sidebox has a dedicated sidebox container ID (or class), so after you have created a category-specific stylesheet, using the "display:none" declaration for sidebox containers will render them invisible.
    20 years a Zencart User

  3. #3
    Join Date
    Feb 2009
    Posts
    23
    Plugin Contributions
    0

    Default Re: Control Sidebox Display Based on Category

    Thanks schoolboy for the reply.
    Have tested and it works.

    Just to let people know what I did:
    I created a .css file and gave it a filename related to the category ID. For category related css, I needed to name the file c_15.css with the 15 being that category ID.
    Within this I created the class
    #sizesminiaturesidebox {display:none;}

    So now this sidebox does not display in that category.
    I then saved it to: includes/templates/YOUR_TEMPLATE/css

    A much simpler solution than expected! (or that I could find from trawling the forum)

    coys

 

 

Similar Threads

  1. Replies: 9
    Last Post: 31 Aug 2011, 02:10 AM
  2. Emergency, which files control category display
    By nonfinite in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 27 Nov 2009, 04:17 AM
  3. Category Display Control code
    By 2redline in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 24 Feb 2009, 03:03 PM
  4. How to control the display of the shopping cart sidebox
    By ajhb in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 28 Aug 2008, 05:45 AM
  5. Stock Control Based on Attributes???
    By abhishek77 in forum General Questions
    Replies: 3
    Last Post: 2 Apr 2008, 09:52 PM

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