Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Join Date
    Mar 2006
    Posts
    921
    Plugin Contributions
    2

    Default Enable the left column for one page...

    I know that it's possible to turn off the left column completely. And I also know that it's possible to override the left (or even right) column and turn it off for certain pages.

    But is this possible...

    I would like to turn the left column off for all pages (with the exception of one - not the homepage).

    Other than using CSS (which would be quite bulky for this simple opperation) is there an easier way?

    Thanks. :)

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

    Default Re: Enable the left column for one page...

    How 'bout something like this in tpl_main_page.php

    if (!$current_page_base == 'yourpagename') {
    $flag_disable_left = true;
    }

  3. #3
    Join Date
    Mar 2006
    Posts
    921
    Plugin Contributions
    2

    Default Re: Enable the left column for one page...

    I really should hang my head in shame!

    I remember (before the option via admin to turn off the left/right columns on the homepage was available) asking a very similar question and this was the solution!

    Thanks Clyde. You've saved me a lot of time! :)

  4. #4
    Join Date
    Mar 2006
    Posts
    921
    Plugin Contributions
    2

    Default Re: Enable the left column for one page...

    Quote Originally Posted by clydejones View Post
    How 'bout something like this in tpl_main_page.php

    if (!$current_page_base == 'yourpagename') {
    $flag_disable_left = true;
    }
    Mmm... that didn't appear to work.

    I'm not sure if this will work at all, because I would first have to turn off the left column via admin and then override the left column for 'yourpagename' in tpl_main_page.php.

    However, I don't think you can override columns when they have been turned off (globally) via admin.

    What makes me think this...

    Show Column Left, unless page override exists?
    0= Column Left is always off
    1= Column Left is on, unless page override
    The above is taken from the admin.

    Do you think/know of a work around?

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

    Default Re: Enable the left column for one page...

    Alex,

    It won't work if the left column is turned off globally. You'll have to set the column to 1 in the admin.

    Then that peice of code should work to turn off the left column on all pages except the for that one page.

  6. #6
    Join Date
    Mar 2006
    Posts
    921
    Plugin Contributions
    2

    Default Re: Enable the left column for one page...

    Ok, that makes sense, but it still isn't working.

    I turned the left column on globally (via admin) and added the following to my tpl_main_page.php...

    Code:
      if (!$current_page_base == 'welcome') {
    	$flag_disable_left = true;
      }
    My page (that I've created is called 'welcome'). The above code was added below this code...

    Code:
    // the following IF statement can be duplicated/modified as needed to set additional flags
      if (in_array($current_page_base,explode(",",'list_pages_to_skip_all_right_sideboxes_on_here,separated_by_commas,and_no_spaces')) ) {
        $flag_disable_right = true;
      }
    When viewing my 'welcome' page in the left column is there, but it's also there on all other pages!

    Have I added the code incorrectly or forgotten to do something? I'm really stumped with this one!

  7. #7
    Join Date
    Mar 2006
    Posts
    921
    Plugin Contributions
    2

    Default Re: Enable the left column for one page...

    Sorted! :)

    I used the following code, which seems to work.

    Code:
    if ($_GET['main_page'] == 'welcome') {
      $flag_disable_left = false;
      } else {
      $flag_disable_left = true;
      }
    Hope it helps someone else! :)

    Thanks for the help Clyde.

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

    Default Re: Enable the left column for one page...

    glad you got it working.

  9. #9
    Join Date
    Mar 2008
    Posts
    148
    Plugin Contributions
    0

    Default Re: Enable the left column for one page...

    Where exactly did you put that code to get it to work? I'm trying to ger a right side box on my main page only and am having no luck. Thanks.

  10. #10
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    20,981
    Plugin Contributions
    25

    Default Re: Enable the left column for one page...

    It would go near the top of tpl_main_page.php.
    PHP Code:
    if (!$this_is_home_page) {
      
    $flag_disable_right true;

    You can put it right below this:
    PHP Code:
    // the following IF statement can be duplicated/modified as needed to set additional flags
      
    if (in_array($current_page_base,explode(",",'list_pages_to_skip_all_right_sideboxes_on_here,separated_by_commas,and_no_spaces')) ) {
        
    $flag_disable_right true;
      } 

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 1
    Last Post: 13 Jan 2007, 11:32 PM
  2. Remove Left Column from Index Page Only
    By thirtytwo16 in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 14 Dec 2006, 08:26 PM
  3. Left Column
    By miles in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 16 Oct 2006, 04:09 AM
  4. help with template
    By lucianman in forum General Questions
    Replies: 1
    Last Post: 12 Oct 2006, 05:11 PM

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
  •