Ignore:
Timestamp:
Oct 26, 2010, 4:37:22 PM (13 years ago)
Author:
plg
Message:

modification: home page is not the same as the root category. This way you can
hide the root category main block on homepage without forbidding access to the
root category.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/PWG_Stuffs/include/functions.inc.php

    r7340 r7402  
    113113}
    114114
    115 function remove_main_block()
     115function hide_main_block()
    116116{
    117117  global $page, $template;
    118118
    119   if (isset($page['section']) and $page['section'] == 'categories' and !isset($page['category']))
     119  if ($page['is_homepage'])
    120120  {
    121     $template->set_prefilter('index', 'remove_main_block_prefilter');
     121    $template->set_prefilter('index', 'hide_main_block_prefilter');
    122122  }
    123123}
    124124
    125 function remove_main_block_prefilter($content, $smarty)
     125function hide_main_block_prefilter($content, $smarty)
    126126{
    127127  return preg_replace('#<div id="content" class="content">.*</div> <!-- content -->#s', '', $content);
Note: See TracChangeset for help on using the changeset viewer.