Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2006
    Posts
    28
    Plugin Contributions
    0

    Default Stumped on Column by Page Removal

    I'm trying to remove the right column from the main index page.

    I have an override in place for tpl_main_page: /templates/my-template/common/tpl_main_page.php.

    The original version has the following code at line 41:

    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;
      }
    In my file I have changed it to:
    Code:
    // the following IF statement can be duplicated/modified as needed to set additional flags
      if (in_array($current_page_base,explode("index",'index')) ) {
        $flag_disable_right = true;
      }
    yet the home page still has the right column.

    I've searched the forums for 3 hours and have seen a lot of potential ways to do it, but I'd like to change as little as possible, and this seems to be the way to go in the latest version.

    Anyone have any ideas?

  2. #2
    Join Date
    Mar 2004
    Posts
    16,042
    Plugin Contributions
    5

    Default Re: Stumped on Column by Page Removal

    you will want to put create a new folder named index in

    includes/templates/your_template

    so its

    includes/templates/your_template/index

    put your modified tpl_main_page in this folder.

    remember to comment the right column
    Zen cart PCI compliant Hosting

  3. #3
    Join Date
    Jan 2006
    Posts
    28
    Plugin Contributions
    0

    Default Re: Stumped on Column by Page Removal

    Thanks for the responce. I obviously had brain freeze, in that I had previously read the commented instruction on the top of tpl_main_page, yet for some reason missed the by page folder part.

    Anyway, for others I did the following to get only the "home" page to drop the right column:

    Code:
     if ($current_page_base == 'index' and $cPath == '') {
       $flag_disable_right = true;
       }
    in place of the original:
    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;
      }
    So now, let me see if I understand this. I have overriden tpl_main_page in mytemplate/common folder which handles pretty much every thing associated with main_page, then I have overriden that file strictly for pages which main_page=index? And in my index override I have simply said if main_page=index with no $cPath (the home page) then don't show the right column.
    That is very sweet.
    Thanks again Merlin.

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

    Default Re: Stumped on Column by Page Removal

    I think you incorrectly modified the code in your first attempt.

    ...explode(",",'list_pages_to_skip_...

    ...explode("index",'index')...

    It should be:

    ...explode(",",'index')...

    I don't know php well enough to explain the "," part, but I do know that every character must be exactly right for it to function correctly.

    If your version works, great! I think the "official" version may cause fewer database queries or otherwise be more efficient, but in this circumstance I don't think it really matters.

  5. #5
    Join Date
    Jan 2006
    Posts
    28
    Plugin Contributions
    0

    Default Re: Stumped on Column by Page Removal

    Thanks gjh42. I'll give it a try and report back for anyone interested.

  6. #6
    Join Date
    Jan 2006
    Posts
    28
    Plugin Contributions
    0

    Default Re: Stumped on Column by Page Removal

    gjh42, you were right. The only difference is that method removes the right column from all main_page=index.... pages. So it removes the right column from for example, the product pages along with the home page. Which makes sence, since there is no reference to the $cPath in that statement.

 

 

Similar Threads

  1. Splash page removal
    By valansi in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 23 May 2011, 05:00 AM
  2. stumped.. really stumped Error 500...again
    By rwslippey in forum Upgrading from 1.3.x to 1.3.9
    Replies: 1
    Last Post: 1 Jul 2010, 02:40 AM
  3. Main Page Box Removal
    By Rerad in forum General Questions
    Replies: 2
    Last Post: 2 Jul 2006, 02:06 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