Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2006
    Location
    SF Bay Area
    Posts
    867
    Plugin Contributions
    1

    Default turn off side columns on home page (code example)

    I tried to find this in the forums but couldn't.

    This hack turns off one (or both) side columns when you are on your sites homepage only.

    If you simply make an override in:
    includes/templates/your-template/index/tpl_main_page.php
    the changes apply to ALL categories, not just the home page.

    Here is simple fix. Add:

    if ($cPath == ""){
    $flag_disable_right = true;
    }

    to the above override file and you can turn off your side column(s) on home page only.

    Hope this helps someone.

    Kiddo

  2. #2
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,289
    Plugin Contributions
    22

    Default Re: turn off side columns on home page (code example)

    use this instead put at the top of the page after comments:

    if ($this_is_home_page == true) {
    $flag_disable_right = true;
    $flag_disable_left = true;
    }
    The full-time Zen Cart Guru. WizTech4ZC.com

  3. #3
    Join Date
    Jul 2006
    Location
    SF Bay Area
    Posts
    867
    Plugin Contributions
    1

    Default Re: turn off side columns on home page (code example)

    Quote Originally Posted by delia View Post
    use this instead put at the top of the page after comments:

    if ($this_is_home_page == true) {
    $flag_disable_right = true;
    $flag_disable_left = true;
    }
    Thanks Delia, Thats a much nicer solution than mine!

    Kiddo

  4. #4
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,289
    Plugin Contributions
    22

    Default Re: turn off side columns on home page (code example)

    you're welcome but real thanks goes to zen cart team for setting things up so nicely!
    The full-time Zen Cart Guru. WizTech4ZC.com

  5. #5
    Join Date
    Nov 2005
    Location
    Colorado Springs, CO USA
    Posts
    7,033
    Plugin Contributions
    31

    Default Re: turn off side columns on home page (code example)

    Quote Originally Posted by delia View Post
    use this instead put at the top of the page after comments:

    if ($this_is_home_page == true) {
    $flag_disable_right = true;
    $flag_disable_left = true;
    }
    You can also write the statement like this:

    Code:
    if ($this_is_home_page) { 
       $flag_disable_right = true;
       $flag_disable_left = true;
    }
    ZC is smart enough to know if the page its on is the home page or not.

 

 

Similar Threads

  1. v151 Turn Off Columns Except for Product Page
    By SPH in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 5 Nov 2012, 10:10 PM
  2. 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
  3. Turn off right and left columns front page only
    By cshart in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 24 Dec 2010, 04:24 AM
  4. Turned off side columns on home page, but space for right column still there.
    By mel150 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 30 Aug 2010, 07:49 PM
  5. 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

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