Page 1 of 3 123 LastLast
Results 1 to 10 of 23
  1. #1
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,371
    Plugin Contributions
    23

    Default Display sidebox only on certain pages

    I want the something to only display on the home page and the categories pages but not the product list pages. I don't recall seeing a hook like that. Looking at the categories sidebox and the category tree functions, there is some code about that:

    Code:
    box_categories_array[$ii]['has_sub_cat']
    .

    I've not been able to figure out how to use that or if can be used for what I'm talking about.

    Any ideas?
    The full-time Zen Cart Guru. WizTech4ZC.com
    New template for 2.0 viewable here: 2.0 Demo

  2. #2
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: Display sidebox only on certain pages

    Try:
    Code:
    if ($this_is_home_page || $category_depth == 'nested' || $category_depth == 'top')
    .
    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,371
    Plugin Contributions
    23

    Default Re: Display sidebox only on certain pages

    beautiful!

    Code to put in the tricks box.

    Thanks!
    The full-time Zen Cart Guru. WizTech4ZC.com
    New template for 2.0 viewable here: 2.0 Demo

  4. #4
    Join Date
    Jul 2010
    Posts
    106
    Plugin Contributions
    0

    Default Re: Display sidebox only on certain pages

    PHP Code:
    if ($this_is_home_page || $category_depth == 'nested' || $category_depth == 'top'
    What adjustment to this code would be necessary to have sideboxes display only on product list area?

    and which file do I add it to?

  5. #5
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,371
    Plugin Contributions
    23

    Default Re: Display sidebox only on certain pages

    Based on this logic, add this to your main page template:

    Code:
    if ($category_depth == 'nested')
    by wrapping it around the sideboxes.

    If you do this you have to either remove the width from that table cell that is adjusted in admin / layout settings or set the width to nothing- empty. Without testing this out, I can't promise this will work.

    But Dr.Byte may have a better suggestion because there are plenty of built in cute little hooks for that kind of thing.
    The full-time Zen Cart Guru. WizTech4ZC.com
    New template for 2.0 viewable here: 2.0 Demo

  6. #6
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: Display sidebox only on certain pages

    "top" = top-level categories
    "nested" = cats and subcats
    "products" = product-listing within said subcat
    .
    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Jun 2011
    Posts
    194
    Plugin Contributions
    0

    Default Re: Display sidebox only on certain pages

    I have some side boxes that i don't want to show up on the home page but everywhere else how do i do that??

  8. #8
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: Display sidebox only on certain pages

    Code:
    !$this_is_home_page
    .
    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  9. #9
    Join Date
    Jun 2011
    Posts
    194
    Plugin Contributions
    0

    Default Re: Display sidebox only on certain pages

    Quote Originally Posted by DrByte View Post
    Code:
    !$this_is_home_page
    Thanks for your reply but where do i put it?

    I tried putting it in the top of the sideboxes i don't want to show on the home page and they won't show anywhere and the content of my home page disappears!!

  10. #10
    Join Date
    Jun 2011
    Posts
    194
    Plugin Contributions
    0

    Default Re: Display sidebox only on certain pages

    Quote Originally Posted by DrByte View Post
    Code:
    !$this_is_home_page
    Quote Originally Posted by gazag View Post
    Thanks for your reply but where do i put it?

    I tried putting it in the top of the sideboxes i don't want to show on the home page and they won't show anywhere and the content of my home page disappears!!
    Don't worry i found it https://www.zen-cart.com/tutorials/i...hp?article=249

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. How do i display certain banners on certain pages?
    By berserkey in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 23 Aug 2011, 07:55 PM
  2. Replies: 6
    Last Post: 15 Feb 2011, 04:46 PM
  3. Display A Category On Certain Pages Only
    By J. Smith in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 25 Feb 2008, 02:34 AM
  4. Sidebox Links BUT only under certain EZ pages
    By bigchili in forum Basic Configuration
    Replies: 5
    Last Post: 7 Feb 2008, 09:55 PM
  5. Only display right column on certain pages
    By qubit in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 3 Jul 2007, 02:05 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