It seems to work with the default Sylvia theme,
it also work with dark/clear, gbo hk-3 and Exposition (my default Theme)
Offline
To work with simple, try this code (remove the other one):
add_event_handler('loc_begin_index', 'remove_main_block');
function remove_main_block()
{
global $page, $template;
if (isset($page['section']) and $page['section'] == 'categories' and !isset($page['category']))
{
$template->set_prefilter('index', 'remove_main_block_prefilter');
}
}
function remove_main_block_prefilter($content, $smarty)
{
return preg_replace('#<div id="content".*</div> <!-- content -->#s', '', $content);
}
After, you must go to admin panel -> tools -> Purge compiled templates
Offline
Thanks P@t. That removed it.
But it appears that for the Simple themes, the Menu is linked to the Main Block. So removing the Main Block also removes the Menu.
Perhaps it's not meant to be.
Offline
Sorry for interrupting and perhaps hijacking the thread .. but seems to be similar problem (though a bit "upgraded".
I've setup PWG Stuffs plugin, and added tags cloud and 3d wall. Both function fine, see here: http://lux.com.hr/gallery/
Now, first part of the problem is same as Darryl asked, and I'll try it today, probably right after posting this post, and that's removing the "Categories" listing from the homepage, leaving only tags cloud & 3d wall on it. <edit>Tried, working "as advertised"</edit>
But I've also noticed that when I go to any of the "Calendar" pages & subpages, I've got tag cloud & 3d wall there as well, see this one for example: http://lux.com.hr/gallery/index.php?/ca … dar-2010-6
So what I need for these pages is exact opposite, and I'm wondering if there is a script for personal plugin similar to one you've made for Darryl, but that would remove 3D wall & cloud tag (or at least the 3D wall) from all calendar pages. I'd be most grateful for any tips, or any help at all..
<edit>And of course, now calendar's main section is completely as well, after running the above script in personal plugin</edit>
Last edited by LuxZg (2010-08-07 14:27:42)
Offline
Hi Darryl,
I have an alternative solution which gives you the effect you want I believe. Rather than getting rid of main block all that you need to do is use the plugin "additional pages" and create a page which you designate as your "home page" and which you can then edit as you so wish. This works for "simple" themes and I enclose a screen shot of my own site using this method. To get the page to be your home page you will need to use the local file editor and add the following line in the local config file
$conf['random_index_redirect'] = array(PHPWG_ROOT_PATH.'index.php?/additional_page/2' => '',);
where the page number is your home page, in this case 2. You will also want to play around with the menus to get a decent presentation. Hope this helps. David.
Offline
[extension by plg] PWG Stuffs version 2.1.f implements the option hide main block from homepage and makes the difference between the home page and the root category page.
Offline