I was talking to Amy yesterday about something I missed in Joomla!
The ability to tell modules to appear on all pages except the selected ones.

Intro to problem
You must know the problem:
You have a module you want on all pages except the home and contact page for instance.
So you go to the modules Menu Assignment and choose Select Menu Item(s) from the List
You select all but Home and Contact. And all is fine and dandy.


Then you add a menu item and oops... the module doesn't display on that new page.
So you have to go back into the module and add that menu item to the selection.


That can get pretty gruesome when you have multiple modules like this. And even worse if you have clients who want to manage their own menu's...

Solution: A Patch?!
Anyway, long story. So I thought today, I would see if I could make a fix for this.

Unfortunately you don't have any triggers in Joomla! on modules (like on content). So you can't use a (system) plugin to do stuff to change the module behavior. Not that I know of anyway...
So I have had to change core files to do the change... a dirty hack. Or - if you want people to use it - call it a patch.

I know, I hate patches too. Patch is lost after Joomla! update and have to repatch... but it is better than nothing.

So I have changed a few files so the option Select Menu Item(s) from the List to Exclude is added.
Then the items you have selected in the Menu Selection will not show the module, and all other pages will.


The code
Because code look kinda daft here, I put it all in a text file:
http://www.nonumber.nl/uploads/com_modules-patch.txt


Your thoughts
I haven't extensively tested this. It works with my first few try outs. So sorry if there are any stupid mistakes in there.

But let me know what you think of the whole idea all together...

Released as extension
http://www.nonumber.nl/advancedmodulemanager

Views: 101

Comment by Sander Potjer on September 29, 2009 at 4:35pm
The idea is very useful, have this problem all the time. When I look into the trunk of Joomla 1.6 it is also something that will be part of the core (currently called "Deselect From List" in edit module view).
Comment by RuiGato on September 30, 2009 at 5:14am
This would be very usefull.

Some options like the ones that "OnAnyPageMod" and "Metamod" modules have would be awsome
Comment by Peter van Westen (NoNumber) on September 30, 2009 at 5:37am
"This would be very usefull."
Well, you can apply the patch to your setup and just use it.
A lot of other options would be very useful indeed, like:
filter by usergroup level, filter by users, display (or not) when no Itemid is known, dependency on other modules, etc...
Hope this will all be a lot easier to control in J! 1.6
Comment by Rene Kreijveld on September 30, 2009 at 5:46am
Great addition! What I'm also looking for is a handy way to see what modules are active on a specific menu item. Any suggestions for this?
Comment by Peter van Westen (NoNumber) on September 30, 2009 at 8:40am
@Rene:
Can you please stop giving these interesting ideas! These things cause me to spend time on making solutions for it, instead of doing what I need to do to make money.

So was this what you mean:


First alpha/development version can be downloaded here:
http://www.nonumber.nl/uploads/ActiveModules-v0.1.0a.zip
Comment by Rene Kreijveld on September 30, 2009 at 8:50am
Whoohoo! Exaclt what I mean. Sometimes you have that: a cetain menu item and you'd like to see what modules are active there... Looks promissing!
Comment by Peter van Westen (NoNumber) on September 30, 2009 at 9:01am
Please install it and let me know what you think...
Comment by Martin Rasser on September 30, 2009 at 11:51am
Dude, I was longing for that feature for a long time! I hope J1.6 will have such a thing vanilla! Cool work!
Comment by Torkil Johnsen on September 30, 2009 at 12:24pm
Hello! This is excellent!

Another thing that would be brilliant would be to be able to display a module on one menu item and automatically on all it's submenu items too, so that whenever you added a submenu item you wouldn't have to manually add modules to that item, it would just inherit the module settings from it's parent item.

.... or maybe that's the solution: Let menu items inherit modules from their parents?

Dude, your activemodules-thingy is excellent. What would make it über-excellent would be if it also had an ajax interface for "add another module", and just a lightbox-ish popup for the modulesettings when you click on the module name.
Comment by Peter van Westen (NoNumber) on September 30, 2009 at 12:27pm
yeah, but this is as far as I came in a few hours. I have a few other extensions on the pile I need to make ready to publish too.

Comment

You need to be a member of All Together, As A Whole to add comments!

Join All Together, As A Whole

Badge

Loading…

© 2012   Created by Amy Stephen.

Badges  |  Report an Issue  |  Terms of Service