Announcement

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

#1 2010-08-04 00:21:09

Darryl
Member
2010-04-27
58

Remove 'Main Block' using PWG Stuffs?

I was playing around with this and it looks like it could help me accomplish my goal of removing the categories from the main window, but only if I could somehow remove the Main Block from the list in PWG Stuffs.

I can add or delete a new block above or below the Main Block, but I'd like to remove Main Block entirely.

Is there any way to do this?

Offline

 

#2 2010-08-04 14:03:36

rio
Piwigo Team
Paris
2006-07-24
1431

Re: Remove 'Main Block' using PWG Stuffs?

I am not sure that I understand what you want to get ...
With a exemple perhaps (draw).
But if I understand there is a GALLY theme. You would probably get what you want.

An exemple : Demo Piwigo

With the icon at the top left, the menu appears and disappears

:-))


-> /<Ä®¿M <-
http://riohome.free.fr
Il forum è anche in ITALIANO

Offline

 

#3 2010-08-04 15:01:24

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

Re: Remove 'Main Block' using PWG Stuffs?

In a personal plugin, add this code:

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" class="content">.*</div> <!-- content -->#s', '', $content);
}


P@t

Offline

 

#4 2010-08-04 16:46:02

Darryl
Member
2010-04-27
58

Re: Remove 'Main Block' using PWG Stuffs?

Thanks P@t! I think this is exactly what I need, but I'm not sure exactly where to put that code.

What do you mean by "in a personal plugin"?

Is there a specific file I am supposed to put this code into?

Thanks in advance.

Offline

 

#5 2010-08-05 08:12:02

rio
Piwigo Team
Paris
2006-07-24
1431

Re: Remove 'Main Block' using PWG Stuffs?

If you have the last version of Piwigo :
Administration --> Plugins --> LocalFiles Editor (must be installed and activated) and then Tab "Personal Plugin"

:-))


-> /<Ä®¿M <-
http://riohome.free.fr
Il forum è anche in ITALIANO

Offline

 

#6 2010-08-05 14:58:49

Darryl
Member
2010-04-27
58

Re: Remove 'Main Block' using PWG Stuffs?

Thanks rio. Unfortunately, this did not do what I had hoped.

What I would like is to do is remove the display of categories when I hit my main page of http://pics.darrylmarsman.com.

The section outlined here is what I want gone:


http://pics.darrylmarsman.com/galleries/Temp/wish.JPG

So that it looks like this:


http://pics.darrylmarsman.com/galleries/Temp/wish2.JPG

And eventually, I would like to add my own content this instead, like this:


http://pics.darrylmarsman.com/galleries/Temp/wish3.JPG

Offline

 

#7 2010-08-05 19:14:20

mol
Piwigo Team Germany
germany
2010-05-26
108

Re: Remove 'Main Block' using PWG Stuffs?

first you use the personal plugin with the postet source
second you install and activate the plugin pwg stuffs
third in pwg stuffs you ad a new modul, the personal block
in the personal block you can create/edit your costom page.
the limits are the same like in the aditional pages
(you can use the plugin fck editor too)

Offline

 

#8 2010-08-05 19:54:03

Darryl
Member
2010-04-27
58

Re: Remove 'Main Block' using PWG Stuffs?

I really do appreciate all the help you guys are offering, but this still isn't working for me.

As per the advice of mol, I just did the following:

1) Confirmed that Administration --> Plugins --> LocalFiles Editor --> "Personal Plugin" Tab has the code offered.

2) I uninstalled and deleted my current PWG Stuffs plugin

3) I redownloaded and reinstalled PWG Stuffs plugin through the Plugins --> Manage --> "Other plugins available" Tab

4) I reactivated PWG Stuffs

5) I can add a second or third module/block just fine

6) I cannot delete the existing module/block that is called "Main Block"

7) When I load my webpage, I still see all of the categories as indicated in my first screenshot in addition to the new blocks I added with PWG Stuffs.

What am I doing wrong?

Offline

 

#9 2010-08-05 20:14:28

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

Re: Remove 'Main Block' using PWG Stuffs?

Did you install and activate your personal plugin?


P@t

Offline

 

#10 2010-08-05 20:28:55

Darryl
Member
2010-04-27
58

Re: Remove 'Main Block' using PWG Stuffs?

This could very well be the reason. I am searching for what that means now. :)

Offline

 

#11 2010-08-05 20:39:23

Darryl
Member
2010-04-27
58

Re: Remove 'Main Block' using PWG Stuffs?

I think you mean for me to go to Plugins --> LocalFiles Editor --> Personal Plugin and add the code:

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" class="content">.*</div> <!-- content -->#s', '', $content);
}

And yes, I did add this code to that section.

Is this what you mean?

Offline

 

#12 2010-08-05 22:27:34

mol
Piwigo Team Germany
germany
2010-05-26
108

Re: Remove 'Main Block' using PWG Stuffs?

Is this what you mean?

and than you must go to the plugin section and install and activate  the personal plugin

Offline

 

#13 2010-08-06 02:05:02

Darryl
Member
2010-04-27
58

Re: Remove 'Main Block' using PWG Stuffs?

That was exactly the problem. I had no idea there was even a plugin listed that was called Personal Plugin! I looked under "other plugins available' and could not find anything called that.

I found it under 'uninstalled plugins' and once I installed/activated it, everything worked like a dream.

Sorry for not understanding what you were talking about and thanks to all who helped.

Hopefully my next question I won't be so dumb.

Offline

 

#14 2010-08-06 02:09:36

Darryl
Member
2010-04-27
58

Re: Remove 'Main Block' using PWG Stuffs?

One last thing, is there any way to make this apply to all themes? It seems to work with the default Sylvia theme, but not the "Simple" themes.

Thanks.

Offline

 

#15 2010-08-06 08:12:55

Gotcha
Former Piwigo Team
Pourrières (83) [FR]
2007-03-14
604

Re: Remove 'Main Block' using PWG Stuffs?

Darryl wrote:

That was exactly the problem. I had no idea there was even a plugin listed that was called Personal Plugin! I looked under "other plugins available' and could not find anything called that.

I found it under 'uninstalled plugins' and once I installed/activated it, everything worked like a dream.

Sorry for not understanding what you were talking about and thanks to all who helped.

Hopefully my next question I won't be so dumb.

Go to :
[ Administration >> Plugins >> LocalFiles Editor >> "Personnal plugin" ]

Offline

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

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact