Page 3 of 3 FirstFirst 123
Results 21 to 24 of 24
  1. #21
    Join Date
    Aug 2006
    Location
    Kihikihi, New Zealand
    Posts
    230
    Plugin Contributions
    3

    Re: Display categories on tpl_index_default.php

    Oops, I forgot to ask how I could get the page to display in the middle of the screen

    Thanks again,

    Goshawk

  2. #22
    Join Date
    Mar 2006
    Posts
    21
    Plugin Contributions
    0

    Default Re: Display categories on tpl_index_default.php

    Goshawk, it's considered poor forum etiquette to 'hijack' a thread with an unrelated problem - this one is about displaying categories on the home page.

    It makes life difficult for people searching for answers when threads contain unrelated discussion. You'd also find people are more willing to help you if you start your own thread with a relevant title.

    Your problem should really be in The Sylesheet forum, although I think you'll make quicker progress if you take a step back and spend some time learning CSS basics. :)

  3. #23

    Default Re: Display categories on tpl_index_default.php

    Quote Originally Posted by DrByte View Post
    Then if you must add custom content "only" when no category is selected, then you'll need to edit as follows:
    /includes/templates/YOURTEMPLATE/templates/tpl_index_categories.php
    at bottom of file, add:
    PHP Code:
    <?php // display my custom content only on home page:
    if (!($current_page!='index' || (int)$cPath>)) {  ?>
    <div><h2>My Custom Content Goes Here</h2></div>
    <?php ?>
    Thanks DrByte, this code came in handy for me as well.

    I used it for News & Article Management Summary Module so that it would only appear on the Index page.

  4. #24
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Display categories on tpl_index_default.php

    The newer, updated approach would be this:

    Code:
    if ($this_is_home_page) {
    // do home page stuff
    }
    or

    Code:
    if (!$this_is_home_page) {
     // do non-home-page stuff
    }
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 
Page 3 of 3 FirstFirst 123

Similar Threads

  1. overrided the tpl_index_default.php page???
    By lieven23 in forum All Other Contributions/Addons
    Replies: 8
    Last Post: 11 Aug 2009, 04:32 PM
  2. tpl_index_default.php not showing in iexplorer
    By kellan4459 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 5 Dec 2008, 02:16 AM
  3. Replies: 4
    Last Post: 18 Jul 2007, 11:53 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