EnglishI 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
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
:-))
Offline
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);
}
Offline
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
If you have the last version of Piwigo :
Administration --> Plugins --> LocalFiles Editor (must be installed and activated) and then Tab "Personal Plugin"
:-))
Offline
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:
So that it looks like this:
And eventually, I would like to add my own content this instead, like this:
Offline
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
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
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
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
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