Extended Menu Auto Expand Sections/Categories [Solution]

This forum is for general questions about extensions for Joomla! version 1.5.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
User avatar
Patitas
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed Sep 10, 2008 10:03 pm
Location: Belo Horizonte, Brazil

Extended Menu Auto Expand Sections/Categories [Solution]

Post by Patitas » Fri Sep 12, 2008 6:28 pm

There is an issue regarding Joomla! 1.5 and the Extended Menu module. The code wasn't properly ported to Joomla! 1.5, so some functions may not work correctly. Extended Menu is a great module ans is the 1st that I install in every new Joomla! site that I'm building. Many features from it were added to the default Menu module in Joomla" 1.5, but the Extended Menu still offers other great tools.

It can be found here: http://extensions.joomla.org/component/ ... temid,35/
One that I discovered is that the Auto Expand Sections/Categories kind of menu doesn't auto populate the menu with links for each content from a given Section/Cetegory in Joomla! 1.5, but works well with Joomla! 1.0. Using this option, when you create a link to a Section or Category in the menu manager, the module auto creates link for all its contents in runtime, without filling the database with endless entries. The problem is that Joomla! changed the way it passes the variables that describe the view type, the content type and so.

The solution for this is altering some files from the module:

modules/mod_exmenu-j15/exmenu/loader/autoexpandedmenu.menuloader.class.php

Change lines 177 to 192 from:

Code: Select all

			switch($menuNode->type) {
				case 'content_category':
				case 'content_blog_category':
				case 'content_archive_category':
					if ($contentItemVisible) {
						$this->categoryMenuNodeList[]	=& $menuNode;
					}
					break;
				case 'content_section':
				case 'content_blog_section':
				case 'content_archive_section':
					if (($categoryVisible) || ($contentItemVisible)) {
						$this->sectionMenuNodeList[]		=& $menuNode;
					}
					break;
			}
to:

Code: Select all

			$tipoMenu = $this->getRawUrlParameter($menuNode->link, 'view');
			switch($tipoMenu) {
				case 'category':
					if ($contentItemVisible) {
						$this->categoryMenuNodeList[]	=& $menuNode;
					}
					break;
				case 'section':
					if (($categoryVisible) || ($contentItemVisible)) {
						$this->sectionMenuNodeList[]		=& $menuNode;
					}
					break;
			}
This will do the work to generate the links, but Extended Menu won't give then the proper classes when they are active, so it's needed to change one more file:

modules/mod_exmenu-j15/exmenu/loader/menuloader.class.php

Change lines 297 to 303 from:

Code: Select all

				switch($task) {
					case 'view':
					case 'edit':
					case 'cancel':
						$result	= $id;
						break;
				}
to:

Code: Select all

$result	= $id;
This is it. I hope this helps anybody that is having this issue and that Daniel implements a Joomla! version checking in the next release of the module to use the correct functions to get the desired variables, like JRequest::getVar('task'); instead of $this->getRequestParameter('task', '');.

I'm using these functions of the module to create an auto accordion menu script that I'll share when it's ready.

Enjoy! :pop

 
User avatar
dizzi
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3136
Joined: Fri Dec 21, 2007 9:36 pm
Location: Yorkshire, UK

Re: Extended Menu Auto Expand Sections/Categories [Solution]

Post by dizzi » Tue Sep 16, 2008 7:26 pm

Hi

I have tested the Joomla 1.5.x version of Extended Menu on a few occasions using both Suckerfish and Son of Suckerfish templates and very limited success. When the drop down menu decides to appear, it usually does so misaligned, incorrectly positioned, with stray characters (un-ordered list bullets) etc. In one particular instance, I spent hours editing the css template but the only visual modification I managed was the background colour of the menubar (I was testing it on the Milkywy template). For some odd reason css selectors which appeared to correspond to certain values, simply had no effect when altered.

This extension worked fine in Joomla 1.0.x but needs some more work in the 1.5.x series. Hopefully this will be addressed because it is quite useful. When it works, it greatly facilitates the addition of a dropdown menu.

Thanks for your contribution, I hope it addresses some of the issues :).

Regards

pancu
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Wed Sep 24, 2008 12:06 pm

Re: Extended Menu Auto Expand Sections/Categories [Solution]

Post by pancu » Wed Sep 24, 2008 12:31 pm

Very Thanks!
Last edited by pancu on Wed Sep 24, 2008 3:37 pm, edited 1 time in total.

xbill82
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Fri Aug 29, 2008 2:18 pm

Re: Extended Menu Auto Expand Sections/Categories [Solution]

Post by xbill82 » Wed Sep 24, 2008 2:37 pm

Patitas...
Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you

your patch is really useful and you saved my life!

L;)

xbill82
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Fri Aug 29, 2008 2:18 pm

Re: Extended Menu Auto Expand Sections/Categories [Solution]

Post by xbill82 » Wed Sep 24, 2008 2:53 pm

Anyway...
there still is another bug, and it's about the itemid the generated menu item puts into the destination URL it points to.
I have a menu. I have a menu composed by 2 menu items that point on 2 different categories.
So, if I click on the normal menu items (the ones I have created from the back-end) everything works fine.
Then, if I roll over these normal menu items I can see appearing the articles contained into the categories they point to, and that's fine. Ok, so: if I click on the generated sub-menu items of the FIRST normal menu item, all is ok, BUT:
if I click on any of the generated sub-menu items of the SECOND normal menu item I go to that article but I get into my URL the itemid of the FIRST normal menu item.
As a consequence I get the module layout of the first menu item and not the one of the first.
There is some kind of error about the itemid calculation that bugs the feature.
I will have a glance at this and if I find some solution I will post it on the forum but please, take a look at this you too because I'm not that expert and we can save time on it.

Thank you again!
L;)

Varsys
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Thu Sep 18, 2008 3:31 pm
Location: Chicago, IL
Contact:

Re: Extended Menu Auto Expand Sections/Categories [Solution]

Post by Varsys » Tue Jan 27, 2009 4:53 pm

Patitas,
It worked for me. Thanks for a helpful post!

emeyer
Joomla! Explorer
Joomla! Explorer
Posts: 352
Joined: Thu Sep 29, 2005 2:37 am

Re: Extended Menu Auto Expand Sections/Categories [Solution]

Post by emeyer » Mon May 04, 2009 1:42 pm

I had the same problem until I set extended menu to tree view, with no template. I didn't want suckerfish or such. That way it expands categories ok without modificaiton, but there are problems with caching. I am on version 1.0.6

First, the module still does not cache properly when autoexpand is enabled. When cache is turned on, the first item selected from a submenu is subsequently displayed as the active item for the entire submenu. It is cached without regard of which item in a submenu should be highlighted. This may reduce the amount of files cached, but it makes the cache unusable.

That causes bigger problems with sh404sef. Like most sef systems, sh404sef generates new database hits for each and every url fetch from an uncached module. This is alot of extra hits on the database for all the items in a menu. It only uses its own cache for items which are declared as cacheable. Thankfully the queries are cached, even if the module itself is not cached, but it still generates unnecessary database hits for the sef translation.

The other problem is with linking to parts of a component. I think this is a general problem with 1.5 still that one can have only one link to a component in a menu. Many components these days are very sophisticated and really need more menu links. Adding more links then the getItemid stops working again.

It is very difficult to understand what is actually setting the itemid in the extended menu php code. It seems much of the old 1.0 functionality is totally replaced by a single call to the 1.5 itemid setter. Sometimes the menu's itemid call is processed before unseffing, and sometimes after. Because sh404sef and other sef systems are components, there doesn't seem to be any way of controlling which thing gets at the itemid first.

I have struggled with these problems for at least four years now, and still it seems there is no clear resolution. I'm beginning to think the real solution is to load the menu without any active highlighting, then have a plugin set the itemid via DOM. That would overcome also another problem: one can only have one instance of the extended menu, or there are multiple ids with the same value (#active), which is not permitted.

emeyer
Joomla! Explorer
Joomla! Explorer
Posts: 352
Joined: Thu Sep 29, 2005 2:37 am

Re: Extended Menu Auto Expand Sections/Categories [Solution]

Post by emeyer » Fri May 22, 2009 2:21 am

Yes, welcome.

If you are new I recommend staying with the Joomla core components as much as possible :0

webberoo
Joomla! Intern
Joomla! Intern
Posts: 80
Joined: Fri May 08, 2009 5:05 am
Location: Melbourne, Australia
Contact:

Re: Extended Menu Auto Expand Sections/Categories [Solution]

Post by webberoo » Wed Jun 10, 2009 6:16 am

Has this fix been incorporated into the module yet?
Affordable websites that work
http://webberoo.in

 

Locked

Return to “Extensions for Joomla! 1.5”