Results 1 to 9 of 9
  1. #1
    Join Date
    Mar 2005
    Posts
    372
    Plugin Contributions
    0

    help question Turn off right and left columns front page only

    How do you make a separate template for the frontpage that only has a center area, but yet have one or 2 columns on every other page?

    Thanks,

    C

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Turn off right and left columns front page only

    Isn't this the same question you asked yesterday? http://www.zen-cart.com/forum/showthread.php?t=166857
    .

    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
    Dec 2006
    Location
    Seligman, MO U.S.A.
    Posts
    2,101
    Plugin Contributions
    5

    Default Re: Turn off right and left columns front page only

    If you're just wanting to hide the left and right columns on the Home Page ONLY, try adding this to your stylesheet.css:

    Code:
    #indexHomeBody #navColumnOne, #indexHomeBody #navColumnTwo {display: none;}
    That will hide those two columns on the Home Page ONLY, and leave them to show on all the rest of your pages.
    Teach them to shop and they will shop today;
    Teach them to Zen and they will OWN a shop tomorrow!

  4. #4
    Join Date
    Mar 2005
    Posts
    372
    Plugin Contributions
    0

    help question Re: Turn off right and left columns front page only

    Quote Originally Posted by Get Em Fast View Post
    If you're just wanting to hide the left and right columns on the Home Page ONLY, try adding this to your stylesheet.css:

    Code:
    #indexHomeBody #navColumnOne, #indexHomeBody #navColumnTwo {display: none;}
    That will hide those two columns on the Home Page ONLY, and leave them to show on all the rest of your pages.
    To answer your question, no it is not really the same question because I need two separte templates one on the frontpage and one for the rest of the pages and did not know how to do that.

    I hide the columns right and left and then I will have to expand the size of the center panel just for the front page. will #indexCenterColumn {width: herenewpx; }or whatever that column is called take care of that problem?

    Thank you for your help.

    C

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

    Default Re: Turn off right and left columns front page only

    No, you don't need two separate templates. If you hide or turn off the sidebars using either the suggested method or the method described in tpl_main_page.php, the center column will expand to fill the space they occupied.

    If you have a bunch of styling you want different for the homepage, you can create a stylesheet named index_home.css with all the rules that apply only to the homepage.
    Last edited by gjh42; 27 Oct 2010 at 06:03 PM.

  6. #6
    Join Date
    Nov 2010
    Posts
    114
    Plugin Contributions
    0

    Default Re: Turn off right and left columns front page only

    Have inserted the index statement several different places in the style sheet with no result. Last location shown below. Does it matter where it is inserted? Classic 1.3.9h Thank You!

    #navColumnOne, #navColumnTwo {
    background-color: transparent;
    }

    #indexHomeBody #navColumnOne, #indexHomeBody #navColumnTwo {display: none;}

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

    Default Re: Turn off right and left columns front page only

    If there is another rule for #navColumnOne after your new rule, any display: xxx; setting in that will override the new one. Try putting your new rule at the end of the stylesheet.

  8. #8
    Join Date
    Nov 2010
    Posts
    114
    Plugin Contributions
    0

    Default Re: Turn off right and left columns front page only

    That part seems to be working, but now I see turning off columns on the category pages is needed also. Do I just add text to the previous change?

    Thanks!

    1.3.9h http: //www.naicsfurniture.com

    PS I know there are other problems. Trying to work through them one at a time.

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

    Default Re: Turn off right and left columns front page only

    That won't work with just stylesheet rules, because there are several kinds of pages with a body id of #indexBody. You need to set flags in /includes/templates/your_template/common/tpl_main_page.php, as described in the comments at the top of that file.

 

 

Similar Threads

  1. turn off left or right side bar on home page only [and only certain EZ pages]
    By thebigkick in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 1 Jun 2012, 10:23 PM
  2. Possible to turn off left & right columns based on page type?
    By edwardtilbury in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 17 Mar 2009, 04:33 AM
  3. Turn off right column in home page only
    By KiwiBrian in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 23 Jul 2008, 08:18 PM
  4. IF statement to turn off left/right column on category page
    By milkyway in forum General Questions
    Replies: 6
    Last Post: 1 Oct 2007, 08:26 AM

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