Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Nov 2006
    Location
    Dartmouth, NS Canada
    Posts
    2,378
    Plugin Contributions
    0

    Default Need both side columns on home page only

    Hi,

    Lots of people want to turn side columns off on the home page. On a site I'm working on I need them both on there. The left side column is on throughout the site, but the client wants the right side column visible only on the home page.

    In admin/Configuration/Layout Settings I can turn on the right side column for the whole site, of course. But there seems to be no settings that affect just the home page. So first question, has anyone written a mod which gives those added settings?

    If no mod exists, how can I approach this? Maybe I can turn on the global setting for the right side column, and then create an override of the tpl_main_page.php file in which I turn off the right sideboxes (and the entire right side column?). But where should that override file go to avoid affecting the home page? Or is it another file that needs to be overridden? Maybe I can override the admin setting when it's off, so that the override is just for the home page and turns it on there?

    As you can see, I need a little guidance.

    Thanks,

    Rob

    ZC v1.3.9h

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,873
    Plugin Contributions
    96

    Default Re: Need both side columns on home page only

    This just requires a small change to /includes/templates/YOUR_TEMPLATE/common/tpl_main_page.php close to the top you'll see the comment in the code fragment below to know where to place it:

    Code:
    // the following IF statement can be duplicated/modified as needed to set additional flags
      if (!$this_is_home_page) {
        $flag_disable_left = true;
        $flag_disable_right = true;
      }

  3. #3
    Join Date
    Nov 2006
    Location
    Dartmouth, NS Canada
    Posts
    2,378
    Plugin Contributions
    0

    Default Re: Need both side columns on home page only

    Um, would that disable both side columns on the Home page? Or is that code a double negative?

    I'm trying to show both side columns on the Home page while leaving only the left column everywhere else.

    Rob

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

    Default Re: Need both side columns on home page only

    Hi Rob

    The ! before $this_is_home_page

    says: If this is NOT the home page, then disable both left and right columns.

    I would therefore say that the following would give you your desired effect

    PHP Code:
    // the following IF statement can be duplicated/modified as needed to set additional flags
      
    if (!$this_is_home_page) {
        
    $flag_disable_right true;
      } 
    20 years a Zencart User

  5. #5
    Join Date
    Nov 2006
    Location
    Dartmouth, NS Canada
    Posts
    2,378
    Plugin Contributions
    0

    Default Re: Need both side columns on home page only

    Quote Originally Posted by schoolboy View Post
    Hi Rob

    The ! before $this_is_home_page

    says: If this is NOT the home page, then disable both left and right columns.

    I would therefore say that the following would give you your desired effect

    PHP Code:
    // the following IF statement can be duplicated/modified as needed to set additional flags
      
    if (!$this_is_home_page) {
        
    $flag_disable_right true;
      } 
    Ah! It's the little things.

    So I take it that I turn on the right column in admin, then use this bit of code in my override of tpl_main_page.php. I'll try that right now. ... ... ...

    Bingo!

    Thanks

    Rob

 

 

Similar Threads

  1. v150 Removing side columns from main page ONLY
    By meljen in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 7 Sep 2012, 11:03 PM
  2. Disable side columns for home page..
    By 19gary72 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 24 Dec 2011, 03:33 PM
  3. Side borders/columns like zen cart home page
    By gaffettape in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 29 Sep 2009, 11:19 AM
  4. turn off side columns on home page (code example)
    By kiddo in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 9 Feb 2007, 03:59 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