Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Dec 2006
    Location
    Tokyo, Melbourne, Shanghai
    Posts
    102
    Plugin Contributions
    0

    Default customising main page while not effecting other pages

    Yesterday I removed the sideboxes from just the main page but could leave them on all other pages. This was a major breakthru for me!!
    It is easily done by assigning a flag for either: left, right, header, footer.

    but

    Now I want to remove only a small portion of the header itself like: the Navigation Breadcrumb, and Categories Bar.

    I used "<!-- blah blah --> to make the Bar not appear but now i cannot see it on any pages!!
    Is there another level to which i can use the override system for just the header of the Main Page but leave all other headers unchanged??

    I also want to remove the centerBoxContent and heading on the main page but want it on all other pages. can this also be done?

    Any help most appreciated.

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: customising main page while not effecting other pages

    If you are using a recent version of Zen Cart you can wrap the code you don't want to be executed on the home page with the following
    if (!$this_is_home_page ) {
    <code to be not executed>
    }
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

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

    Default Re: customising main page while not effecting other pages

    Now I want to remove only a small portion of the header itself like: the Navigation Breadcrumb
    If you're using version 1.3.7 you can control the breadcrumb in admin -> configuration -> layout settings: you can turn them off completely turn them on for all pages or turn them off on just the main page.

  4. #4
    Join Date
    Jan 2007
    Posts
    88
    Plugin Contributions
    0

    Default Re: customising main page while not effecting other pages

    I know how n00b this sounds but which files would be the files to work on if I had to do any hand coding for the main page?

  5. #5
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: customising main page while not effecting other pages

    That would depend. The structure of the main page is controlled by common/tpl_main_page.php, but it pulls in content from the entire template system. Could you provide more information about what you'd like to do.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  6. #6
    Join Date
    Jan 2007
    Posts
    88
    Plugin Contributions
    0

    Default Re: customising main page while not effecting other pages

    Basically I would have several images and one log in box.

    What I am doing will make this main page look like a brochure cover.

  7. #7
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: customising main page while not effecting other pages

    In which case your best bet is probably to use the $this_is_home_page variable in the tpl_main_page template with a statement such as
    PHP Code:
    if ($this_is_home_page) {
      require(
    custom_landing_page.php);
    } else {
      require(
    $body_code);

    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  8. #8
    Join Date
    Jan 2007
    Posts
    88
    Plugin Contributions
    0

    Default Re: customising main page while not effecting other pages

    I found it in the common for template I also have this page though: tpl_index_default.php

    Do I need to edit that as well?

    Also I can just code the "custom_landing_page" with anything and have such things as the categories on the side?
    Last edited by Outlawlb; 16 Jan 2007 at 03:07 PM.

  9. #9
    Join Date
    Jan 2007
    Posts
    88
    Plugin Contributions
    0

    Default Re: customising main page while not effecting other pages

    And where do I place the custom landing page? Anywhere I need to?

  10. #10
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: customising main page while not effecting other pages

    One of the joys of Zen Cart is that there are often many ways of achieving the same thing, especially when you get into coding. Of course, that can also be confusing.

    The best way of implementing your changes will depend on how much change you want to make to the front page. If it's just some changes to the center column below the bradcrumbs then editing the tpl_index_default.php file may be the best approach. If it's largely the same structure, but has different content on the home page, you may wish to insert the different code directly into an IF statement such as that above, in the place that you want the alternative content to appear in the tpl_main_page.php file (a look at the large comment in the header of this file explains many more localiszed changes you could make such as selectively turning sideboxes on and off). If the page will look radically different, you might wish to simply call a completely different page. There's no right answer, it depends on the design.

    One thing to absolutely master however, is the override system. Hopefully you're already on this. If not a quick visit to the FAQ and the Wiki will save a lot of heartache later.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Display slideshow at main page and hide in other pages like new_products
    By ritesh.shrestha in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 16 Sep 2011, 05:50 PM
  2. Replies: 1
    Last Post: 17 Oct 2009, 11:50 PM
  3. Restrict main page picture from showing in pages other than home page
    By dealbyethan.com in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 4 Apr 2007, 05:33 PM

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