Announcement

  •  » Extensions
  •  » Remove 'Main Block' using PWG Stuffs?

#16 2010-08-06 08:52:33

mol
Piwigo Team Germany
germany
2010-05-26
108

Re: Remove 'Main Block' using PWG Stuffs?

It seems to work with the default Sylvia theme,

it also work with dark/clear,  gbo hk-3 and Exposition (my default Theme)

Offline

 

#17 2010-08-06 11:42:14

P@t
Piwigo Team
Nice
2007-06-13
4098

Re: Remove 'Main Block' using PWG Stuffs?

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


P@t

Offline

 

#18 2010-08-06 13:22:38

Darryl
Member
2010-04-27
58

Re: Remove 'Main Block' using PWG Stuffs?

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

 

#19 2010-08-07 14:20:12

LuxZg
Member
2010-08-06
22

Re: Remove 'Main Block' using PWG Stuffs?

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

 

#20 2010-08-22 16:50:59

Davids
Member
Basingstoke, UK
2010-02-04
70

Re: Remove 'Main Block' using PWG Stuffs?

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.


Uploaded Images

Offline

 

#21 2010-10-26 20:59:49

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13182

Re: Remove 'Main Block' using PWG Stuffs?

[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.


Latest blog post (November 9th 2018) Why Flickr could not remain free for ever

Offline

 
  •  » Extensions
  •  » Remove 'Main Block' using PWG Stuffs?

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2019 · Contact