Results 1 to 9 of 9
  1. #1
    Join Date
    Oct 2012
    Posts
    48
    Plugin Contributions
    0

    Default Customising the main page template

    Hi Everyone

    I am trying to make the following changes and need some help.

    I have a left box a centre box and right hand side box
    What I would like to do is turn the right hand side box off on certain pages

    I can see that this is ossible in the main page template so how do I create a page specific main ppage template
    I have had a look in the file and it does say that I can copy it call it by the page name and edit a specific page but I dont seem to be doing something corretcly can anyone point me in the right direction

    regards

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

    Default Re: Customising the main page template

    The simplest way to do this (especially if you have more than one page where you want the right sidebar off) is to use the commented code near the top of tpl_main_page.php:
    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;
      } 
    Save the edited file to your custom template folder (/includes/templates/your_template/common/tpl_main_page.php).

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

    Default Re: Customising the main page template

    "Current_page_base" is what you see in the address bar after main_page=.

  4. #4
    Join Date
    Oct 2012
    Posts
    48
    Plugin Contributions
    0

    Default Re: Customising the main page template

    Quote Originally Posted by gjh42 View Post
    "Current_page_base" is what you see in the address bar after main_page=.
    Thanks for your help so far I have located the file and managed to change the privacy age easy enough however I am running the ultimate seo URL add on and It seems no matter how I try I cant get pages effected by the mod to work.

    the page I am trying to alter is

    .avinstalls.co.uk/tv-installation-services-c-1_2.html

    I have tried using this URL and what I presume would be the natural URL index&cPath=1_2

    I have also tried cPath=1_2

    starting to hurt my head now lol

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

    Default Re: Customising the main page template

    index&cPath=1_2 is not a page base, it is a complete category path. Since it is an "index" page, you need to use that in the test. However, "index" includes the homepage, category listings and product listings, so for this you would need to use one of the other commented tests in tpl_main_page.php. Don't change the one that is working for your privacy page, but uncomment and tweak this one:
    PHP Code:
     // example to not display right column on main page when Always Show Categories is OFF<br />
     
    * <br />
     * if (
    $current_page_base == 'index' and $cPath == '') {<br />
     *  
    $flag_disable_right true;<br />
     * }<
    br /> 
    Copy the code to lower in the file (say just above the if(in_array... test) and edit like this:
    PHP Code:
     if ($current_page_base == 'index' and $cPath == '1_2') {
       
    $flag_disable_right true;
     } 

  6. #6
    Join Date
    Oct 2012
    Posts
    48
    Plugin Contributions
    0

    Default Re: Customising the main page template

    To Man / or Lady

    Thanks so much I seem to have that upp and running now much appreciated.
    I am trying to reorganise the category listing pages I need to add content but am finding if you start a category of with 500 words before you get to the next to the next ppage options you are well below the fold.
    I am considering moving the product listings or list sub categories above the category description so in the fold there is a clear route to the next page and below that all the written content to assist in rankings.

    By the way I love zencart I knew nothing about all this jazz a year ago and now I am customising and adding new stiff all the time its a fantastic piece of kit :)

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

    Default Re: Customising the main page template

    You will need to edit /includes/templates/your_template/templates/tpl_index_categories.php (copy it from /template_default/).
    Move this part
    PHP Code:
    <?php
    // categories_description
        
    if ($current_categories_description != '') {
    ?>
    <div id="categoryDescription" class="catDescContent"><?php echo $current_categories_description;  ?></div>
    <?php // categories_description ?>
    to immediately below
    PHP Code:
    <!-- EOFDisplay grid of available sub-categories --> 
    There could be other locations to move it to, depending on your exact layout desires.

  8. #8
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Customising the main page template

    Quote Originally Posted by BoydBreen View Post
    To Man / or Lady
    Glenn is a guy..
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  9. #9
    Join Date
    Oct 2012
    Posts
    48
    Plugin Contributions
    0

    Default Re: Customising the main page template

    Thanks Glenn for all you help :)

 

 

Similar Threads

  1. Editing the template main page
    By SB1024 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 21 Dec 2010, 07:50 PM
  2. Customising Login and Main Page
    By Javier in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 14 Nov 2009, 10:31 PM
  3. Customising colour behind the template
    By Green333 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 21 Aug 2008, 07:52 AM
  4. customising main page while not effecting other pages
    By arpeggio in forum Templates, Stylesheets, Page Layout
    Replies: 12
    Last Post: 22 Jan 2007, 05:42 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