Extended Menu

Do you have an Open Source Product available for Joomla!? Let everyone know here.
Forum rules
Global Rules
Additional Rules for this forum <------- Please read before posting
Locked
de
Joomla! Ace
Joomla! Ace
Posts: 1477
Joined: Thu Aug 18, 2005 9:06 am
Contact:

Re: Extended Menu

Post by de » Mon Jan 16, 2006 2:46 am

Ok, here comes the fix...

in /includes/database.php about line 513 you will see:

Code: Select all

		while ($row = mysql_fetch_row( $cur )) {
change it to:

Code: Select all

		while ($row = mysql_fetch_array( $cur )) {
(you should otherwise also see some notice messages - if error reporting is high enough)

Edit: this change is not necessary anymore since version 1.0.0 (rc1)
Last edited by de on Sat Feb 04, 2006 12:06 am, edited 1 time in total.

User avatar
htsolutions
Joomla! Intern
Joomla! Intern
Posts: 50
Joined: Tue Dec 27, 2005 3:31 pm
Location: Michigan
Contact:

Re: Extended Menu

Post by htsolutions » Mon Jan 16, 2006 2:56 am

Oh Yeah Fixed it..


Thanks daniel for your dedication!


;D

pastoweb
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 134
Joined: Sun Nov 27, 2005 11:27 am
Contact:

sef compatibility

Post by pastoweb » Mon Jan 16, 2006 11:42 am

Hi de, I installed coresef hack (http://forge.joomla.org/sf/projects/coresef) for better sef compatibility, but menu items doesn't expand anymore.

(your menu works ok with standard joomla 1.0.4 sef so I can go back, but maybe it' some issue you can fix...)

de
Joomla! Ace
Joomla! Ace
Posts: 1477
Joined: Thu Aug 18, 2005 9:06 am
Contact:

Re: sef compatibility

Post by de » Mon Jan 16, 2006 12:25 pm

pastoweb wrote: Hi de, I installed coresef hack (http://forge.joomla.org/sf/projects/coresef) for better sef compatibility, but menu items doesn't expand anymore.
I am quite sure that it has to do with the Itemid and the coresef hack not giving a 100% reversible URL... for some it may be good (was already mentioned in XE) as it reduces the duplicate URLs... on the other hand everything depending on the Itemid does not work properly anymore.
(Note that I am just guessing this from what you mention... I never tried or looked at the coresef hack by myself)

You could try another SEF component for example (it works find with 404 SEF, but this one does not seem to have a bright future I guess).

Maybe the next version of my menu module will try to be smarter... but no promises (actually I wanted a new version out already).

pastoweb
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 134
Joined: Sun Nov 27, 2005 11:27 am
Contact:

Re: Extended Menu

Post by pastoweb » Mon Jan 16, 2006 6:15 pm

With OpenSef it works fine

camos
Joomla! Ace
Joomla! Ace
Posts: 1056
Joined: Thu Aug 18, 2005 2:39 am

Re: Extended Menu

Post by camos » Mon Jan 16, 2006 7:06 pm

de wrote: Ok, here comes the fix...

in /includes/database.php about line 513 you will see:

Code: Select all

		while ($row = mysql_fetch_row( $cur )) {
change it to:

Code: Select all

		while ($row = mysql_fetch_array( $cur )) {
(you should otherwise also see some notice messages - if error reporting is high enough)
This fixes the XTmenu but will it mess up other aspects of Joomla and/or will the change make it into the core?

Cheers
Freedom is not free!
It is however Open Source.

de
Joomla! Ace
Joomla! Ace
Posts: 1477
Joined: Thu Aug 18, 2005 9:06 am
Contact:

Re: Extended Menu

Post by de » Mon Jan 16, 2006 7:21 pm

camos wrote: This fixes the XTmenu but will it mess up other aspects of Joomla and/or will the change make it into the core?
That is what it was before... the method change made it break backward compatible partially and I see a 50:50 chance (depending how they use it) that it would break other addons/hacks that are using the function loadRowList as well. I think such a change should not have introduced in a security release. So I am quite confident it will do more good than harm.
(The function mysql_fetch_array will add the field names as array keys in addition to the numeric keys)
Last edited by de on Mon Jan 16, 2006 7:27 pm, edited 1 time in total.

camos
Joomla! Ace
Joomla! Ace
Posts: 1056
Joined: Thu Aug 18, 2005 2:39 am

Re: Extended Menu

Post by camos » Mon Jan 16, 2006 7:39 pm

What a bother!
Now your cool menu requires a core hack to work which may or may not mess up other addons.
Gack...

Anyway, you have mentioned a new version.  Do you have a projected release date yet?

Cheers
Freedom is not free!
It is however Open Source.

de
Joomla! Ace
Joomla! Ace
Posts: 1477
Joined: Thu Aug 18, 2005 9:06 am
Contact:

Re: Extended Menu

Post by de » Mon Jan 16, 2006 7:44 pm

camos wrote: What a bother!
Now your cool menu requires a core hack to work which may or may not mess up other addons.
Gack...
Actually I meant that I see the 50:50 chance that addons (but only those using that function) may or may not break without that modification (like it did break my addon)... that the change will break other addons should have a chance next to zero (as it is just introduced in 1.0.6/1.0.7)... that it breaks the core maybe 1%.
camos wrote: Anyway, you have mentioned a new version.  Do you have a projected release date yet?
Nope... but should be until the next weekend.

camos
Joomla! Ace
Joomla! Ace
Posts: 1056
Joined: Thu Aug 18, 2005 2:39 am

Re: Extended Menu

Post by camos » Tue Jan 17, 2006 10:22 pm

You have probably noticed it but just thought I would mention the problem with disappearing dropdowns with IE is also exhibited by the horizontal suckerfish example on your site.  That would indicate the problem is with the suckerfish code rather than with your code.  Except that the Moslate/howtos menu item in your menu does not display under IE so perhaps a combination of errors.  Also there is a syntax error displayed.

Trying to get the right arrow to display.  I see in topnav/css/menu.css this entry:
ul.mainlevel-topnav ul .expanded{display:block; background-image:url("../images/expanded_right.gif");

How does the .expanded get added?  I'm not getting it in the source code.

Cheers
Freedom is not free!
It is however Open Source.

de
Joomla! Ace
Joomla! Ace
Posts: 1477
Joined: Thu Aug 18, 2005 9:06 am
Contact:

Re: Extended Menu

Post by de » Tue Jan 17, 2006 11:44 pm

camos wrote: You have probably noticed it but just thought I would mention the problem with disappearing dropdowns with IE is also exhibited by the horizontal suckerfish example on your site.  That would indicate the problem is with the suckerfish code rather than with your code.  Except that the Moslate/howtos menu item in your menu does not display under IE so perhaps a combination of errors.  Also there is a syntax error displayed.
Honestly I did not completely understood the problem but had the feeling that it had to do with relative positioning... I workaround it however by defering the non-hover state... seems to work fine - I just did not upload the new version yet.
camos wrote: Trying to get the right arrow to display.  I see in topnav/css/menu.css this entry:
ul.mainlevel-topnav ul .expanded{display:block; background-image:url("../images/expanded_right.gif");

How does the .expanded get added?  I'm not getting it in the source code.
That is part of the new version when it is available. It means a modification of the menu.html and I believe it is not possible with the latest (yet) release of the extended menu module. I hope you have just a little more patience... a release canditate will be available very soon and a release shortly after.

mikedfunk
Joomla! Apprentice
Joomla! Apprentice
Posts: 23
Joined: Thu Jan 12, 2006 10:10 pm

Re: Extended Menu

Post by mikedfunk » Wed Jan 18, 2006 4:11 pm

De, thanks for your help earlier. While the copy button caused me to slap my forehead (I didn't see it), It doesn't allow me to edit the core files of the module separately because it creates a separate instance of the module and not separate core files. But the following suggestion was JUST what I was looking for!

Anyway, I have another hopefully simple question. How do I use the extended menu to show a list containing links to only level 2 of the menu? Once again, I've fiddled with the "begin with" parameter but I haven't been able to create a static single-level menu containing only level 2 of the navigation. How do I do this??

KipBond
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Wed Dec 14, 2005 3:47 pm

Re: Extended Menu

Post by KipBond » Wed Jan 18, 2006 4:12 pm

camos wrote:
de wrote: Ok, here comes the fix...

in /includes/database.php about line 513 you will see:

Code: Select all

		while ($row = mysql_fetch_row( $cur )) {
change it to:

Code: Select all

		while ($row = mysql_fetch_array( $cur )) {
(you should otherwise also see some notice messages - if error reporting is high enough)
This fixes the XTmenu but will it mess up other aspects of Joomla and/or will the change make it into the core?
I'm wondering the same -- Can one of the Joomla core team speak to this?  I also noticed that now if you delete a "main_menu" module, it'll delete the associated menu (if it is empty).  I didn't notice this before.  Honestly, I think the "menus" should be completely separate from the modules that use the menus (mainmenu, exmenu), and it shouldn't automatically create a "mainmenu" module when you create a new menu -- or it should be an option you can unselect at least.

camos
Joomla! Ace
Joomla! Ace
Posts: 1056
Joined: Thu Aug 18, 2005 2:39 am

Re: Extended Menu

Post by camos » Wed Jan 18, 2006 5:05 pm

I can be patient.
I am certain I have been patient at least once or twice in the past.
Perhaps even more than that.
No worries. :D

Getting cross browser compliance for CSS positioning is a big PITA.  I found this:
IE5.01 Jumping Menu Bug
Anyone using IE5.01 on Windows will notice that the menu jumps around when you hover over some of its items. The problem is easily fixed by modifying our previous hacks as follows:

/* Fix IE. Hide from IE Mac \*/
* html ul li { float: left; height: 1%; }
* html ul li a { height: 1%; }
/* End */

Mystery IE6 Bug:
During the development of this article, I uncovered a strange bug that I believe is only apparent in IE6. A background must be declared on the li a, else when a sub-menu stretches further (vertically) than the main menu itself, the links start to disappear before you have time to click them. Strange! Try it to see for yourself.
@ http://www.alistapart.com/articles/horizdropdowns/
Which seems to describe what is happening in IE although I am not using either a Mac or IE5, the jumping is apparent on your site menu.  With IE6 the disappearing dropdown is apparent only when crossing the boundary between the first level and the dropdown.

Looking forward to your new version.
Cheers
Freedom is not free!
It is however Open Source.

KipBond
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Wed Dec 14, 2005 3:47 pm

Re: Extended Menu

Post by KipBond » Wed Jan 18, 2006 5:38 pm

Is there some way to "combine" menus?  For instance, if I want one menu item to be an expanded list of section/category content items, how would I do this?

Explain:

menu: "my_menu"
- Home
- Links
- Documents*
- Contact Us


* Where "Documents" would be a section or category and not a statically defined menu -- it would instead be a dynamic list of content items in a specified section/category.

de
Joomla! Ace
Joomla! Ace
Posts: 1477
Joined: Thu Aug 18, 2005 9:06 am
Contact:

Re: Extended Menu

Post by de » Wed Jan 18, 2006 8:43 pm

mikedfunk wrote: Anyway, I have another hopefully simple question. How do I use the extended menu to show a list containing links to only level 2 of the menu? Once again, I've fiddled with the "begin with" parameter but I haven't been able to create a static single-level menu containing only level 2 of the navigation. How do I do this??
There are mainly two parameters with similar but not same behaviour for this purpose: "Maximum Depth" (that is the one I suggest to use) and "Split Menu"
Additionally the menu style "Flat List" and "Horizontal" (not recommended) render one level only.

de
Joomla! Ace
Joomla! Ace
Posts: 1477
Joined: Thu Aug 18, 2005 9:06 am
Contact:

Re: Extended Menu

Post by de » Wed Jan 18, 2006 8:47 pm

KipBond wrote: Is there some way to "combine" menus?  For instance, if I want one menu item to be an expanded list of section/category content items, how would I do this?
...
The intention of the "extended menu" modul is to just visualise what you defined using the menu manager... a combination is not possible (at least not yet and I cannot really think of a good way to do so).
However, it is actually a secret, but the next version will also allow you to automatically expand sections and categories (which should have the desired effect).
Last edited by de on Wed Jan 18, 2006 8:49 pm, edited 1 time in total.

KipBond
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Wed Dec 14, 2005 3:47 pm

Re: Extended Menu

Post by KipBond » Wed Jan 18, 2006 9:04 pm

de wrote:The intention of the "extended menu" modul is to just visualise what you defined using the menu manager... a combination is not possible (at least not yet and I cannot really think of a good way to do so).
However, it is actually a secret, but the next version will also allow you to automatically expand sections and categories (which should have the desired effect).
I thought that's what the "Section..." or "Category..." source types were for?  I was able to pull a list of content items from a section.  But, I need that to be a submenu of another menu.  That's why I thought combining menus would be helpful.  You could define one module to be a menu of content items in a section, and then have that menu be a submenu of another menu module.  Or, maybe one "source" option would be other extended menu modules?  Then you can specify which modules and their order.

I suppose a better way would be to have this built into the "menu" system, where "submenu" would be an item you could place in the menu.  :-?  Just a thought... I'll end up having to just include links to each content item separately, and change my menus every time I change the content. 

de
Joomla! Ace
Joomla! Ace
Posts: 1477
Joined: Thu Aug 18, 2005 9:06 am
Contact:

Re: Extended Menu

Post by de » Wed Jan 18, 2006 9:14 pm

KipBond wrote: I thought that's what the "Section..." or "Category..." source types were for? I was able to pull a list of content items from a section.  But, I need that to be a submenu of another menu.  That's why I thought combining menus would be helpful.  You could define one module to be a menu of content items in a section, and then have that menu be a submenu of another menu module.  Or, maybe one "source" option would be other extended menu modules?  Then you can specify which modules and their order.
Ok true... that thing is an "exception" in a way... but even there the content manager is used in place of the menu manager. The problem is how to tell which other source to assign to which item... just selecting another source would display it in-place - just like it is now done with the sections, categories.
KipBond wrote: I suppose a better way would be to have this built into the "menu" system, where "submenu" would be an item you could place in the menu.  :-?  Just a thought... I'll end up having to just include links to each content item separately, and change my menus every time I change the content. 
I think best would be an option for each (section, category) menu item whether it should expand or not. The new version will let you expand all sections and categories (not each on it's own).

camos
Joomla! Ace
Joomla! Ace
Posts: 1056
Joined: Thu Aug 18, 2005 2:39 am

Re: Extended Menu

Post by camos » Thu Jan 19, 2006 12:59 am

Whichever way a menu is displayed, it is still static at this time.  It will only display menu items that have been entered into one of the Menu Manager menus.  There is a module called content-nav that will pull from the DB a list of sections, a list of categories or a list of content items depending on where you are in the site.  There probably isn't much reason that could not be done in a menu as well but I'm pretty sure it hasn't.

Cheers
Freedom is not free!
It is however Open Source.

de
Joomla! Ace
Joomla! Ace
Posts: 1477
Joined: Thu Aug 18, 2005 9:06 am
Contact:

Extended Menu 1.0.0-rc1 available

Post by de » Thu Jan 19, 2006 2:05 pm

So here it is... somehow I have the feeling that I forgot something (but well, I don't remember what it was;-)...

This version is not the final version so don't use it on a important production site unless you tested it by yourself enough.
I'd be glad if some could test it and let me know about any issues.
(Some refactory was done so there may very well be a few issues)

Some main improvements of the new version:
  • automatically expand section/category menu items
  • create also section/category links... (may not need to be always expanded)... behaves now more like normal menu items
  • plugin support: add your own menu source or menu view by writing a simple plugin/mambot without hacking the module (sample plugins available) - this feature is currently beta and may change a little if necessary
  • more intelligent current/active menu item highlighting (may ignore Itemid completely)
  • menu templates updated (suckerfish menu template improved)
  • ...
The new documentation is not yet uploaded (will be with the final version)... some links:


I hope you are having fun with it.

Edit: (links removed); version 1.0.0 (final) is now available with the above and slightly more improvements.
Last edited by de on Sun Jan 29, 2006 12:24 pm, edited 1 time in total.

quiquedcode
Joomla! Ace
Joomla! Ace
Posts: 1378
Joined: Thu Aug 18, 2005 10:11 pm
Location: San Juan - Argentina
Contact:

Re: Extended Menu

Post by quiquedcode » Thu Jan 19, 2006 8:26 pm

:'( ohh damn...
I tried this version and I'm getting the same result ( in Firefox )
I don't know what I'm doing badly...

I do:

- install module

- I extract files from suckerfish-horizontal-1.0.0-rc1.zip
I extract js folder into my template folder
I extrat the images, the menu.html ( I ignore the ini file )
I extract the 3 css files (menu.css ... menu_2.css ... menu_temp.css) and I copy the code in each file to my template_css.css file. I paste the code at bottom of my template_css.css file so it overwrites all of the prior css code (if necessary)

- I set the module parameters
menu class and module class suffix = -suckerfish-horizontal
menu name = mainmenu
menu style = Flat List

And well, these are the results...

FireFox
Image

IE
Image

So... Could anyone share with me an already made template which uses this module and suckerfish horizontal template ?

I'd like to get the suckerfish looking nice in Firefox, and to fix that IE look... I uploaded my template here (don't install through template installer, upload to your templates folder)

Thanks a lot in advance.
You do not have the required permissions to view the files attached to this post.
@kabeza
Freelance Joomla/CodeIgniter Developer
Home: http://www.beza.com.ar

de
Joomla! Ace
Joomla! Ace
Posts: 1477
Joined: Thu Aug 18, 2005 9:06 am
Contact:

Re: Extended Menu

Post by de » Thu Jan 19, 2006 8:49 pm

It should actually have a fixed width also in the Firefox... and of course horizontal.
Something seem to overwrite your styles or they are not used for some reasons.
Btw. there is also the son-of-suckerfish-horizontal available.

The "Menu Class Suffix" is important here.

Ok, that there are three CSS files is an error... forgot to remove them... only menu.css has to be used... maybe that is the problem here?

quiquedcode
Joomla! Ace
Joomla! Ace
Posts: 1378
Joined: Thu Aug 18, 2005 10:11 pm
Location: San Juan - Argentina
Contact:

Re: Extended Menu

Post by quiquedcode » Thu Jan 19, 2006 9:36 pm

I tried using menu.css only ... and I have the same problem
I tried -son-of-suckerfish-horizontal and the only result I got was that it fixed the "height bug" in each menuitem

Look at the image:

Image

Hope someone can share a template to see what I did wrong... don't know what to do  :-[ :'( :(
@kabeza
Freelance Joomla/CodeIgniter Developer
Home: http://www.beza.com.ar

de
Joomla! Ace
Joomla! Ace
Posts: 1477
Joined: Thu Aug 18, 2005 9:06 am
Contact:

Re: Extended Menu

Post by de » Thu Jan 19, 2006 11:32 pm

I just did it now with a plain Joomla 1.0.7 and the solarflare ii template and did it very similar...

One issue I had was that there were bullet points in front of it because the solarflare was applying them to each li element... that can be removed with CSS again and I will add it to the version of the menu templates. But that seem not the problem in your case... but you still seem to have the margin, try the following:

Code: Select all

ul.mainlevel-suckerfish-horizontal li {
	padding: 0;
	margin: 0;
	background: none;
}
Then if it was just applied to the module position "left" it appeared vertical as well... because the area were to small (the menu items are floating and will not cause a horizontal scrollbar but go for the next line instead)... if I then used the module position "user3" all was fine.
So make sure that your container element is not too small.

quiquedcode
Joomla! Ace
Joomla! Ace
Posts: 1378
Joined: Thu Aug 18, 2005 10:11 pm
Location: San Juan - Argentina
Contact:

Re: Extended Menu

Post by quiquedcode » Fri Jan 20, 2006 12:48 am

Hi de
your CSS code made a great progress, but...
Look how it looks :

FIREFOX
Image

IE
Image

I also checked the menu container... it is a simple table, 725 pixels width... and there are only 4 menuitems published...

Don't know what's wrong  :-\... but well... I apreciatte your help, a lot ...
Thanks de !!
@kabeza
Freelance Joomla/CodeIgniter Developer
Home: http://www.beza.com.ar

de
Joomla! Ace
Joomla! Ace
Posts: 1477
Joined: Thu Aug 18, 2005 9:06 am
Contact:

Re: Extended Menu

Post by de » Fri Jan 20, 2006 1:04 am

Hmm at the moment I have no idea what would cause this...
But my suggestion is to remove/comment all your other CSS and then selectively uncomment it to find the part which is causeing it.

quiquedcode
Joomla! Ace
Joomla! Ace
Posts: 1378
Joined: Thu Aug 18, 2005 10:11 pm
Location: San Juan - Argentina
Contact:

Re: Extended Menu

Post by quiquedcode » Fri Jan 20, 2006 1:23 am

Hi de ( you still awake ? 3:20am there... wow )
I tried that, removed all the other css from my template_css.css and left only the code contained in menu.css
I get this:

Image

I will go through each .code in css and will keep you updated.
10.23 pm here... time to give the brain a rest...

Thanks for helping...
@kabeza
Freelance Joomla/CodeIgniter Developer
Home: http://www.beza.com.ar

User avatar
Elpie
Joomla! Guru
Joomla! Guru
Posts: 903
Joined: Wed Aug 17, 2005 11:26 pm
Contact:

Re: Extended Menu

Post by Elpie » Mon Jan 23, 2006 2:36 am

Hi all,
I am not using extended menu, but I am using a dhtml menu with submenu items and the parent as a seperator.
I have been pulling my hair out for the last two days trying to get around a positioning problem for the menu module.
As luck would have it, I was speaking with Masterchief and he had just been working through the same problem.  There is a bug. Whether it affects Extended Menu or not, I am not sure as I haven't tested EM.

Thought I would post Andrew's fix anyway. 

In /includes/joomla.php look around line 3634, find this function and replace upper portion as follows:

Code: Select all

function MenuLinks( &$lookup, $all=NULL, $none=NULL, $unassigned=1 ) {
  global $database;

  // get a list of the menu items
  $query = "SELECT m.*"
  . "\n FROM #__menu AS m"
//  . "\n WHERE type != 'url'"
//  . "\n AND type != 'separator'"
// Change adds Itemid support for Link - Urls without `index.php` or `Itemid=` in their url
  . "\n WHERE m.published = 1"
  //. "\n AND m.type != 'separator'"
  . "\n AND NOT ("
   . "\n ( m.type = 'url' )"
   . "\n AND ( m.link LIKE '%index.php%' )"
   . "\n AND ( m.link LIKE '%Itemid=%' )"
  . "\n )"
  . "\n ORDER BY m.menutype, m.parent, m.ordering"
  ;
As this is a bug, I assume it will be fixed in a release.  It may help you all, it may not ;)
For Mambo assistance: http://forum.mambo-foundation.org
Open Source Research & Best Practice: http://osprojects.info

n3n
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Sun Nov 13, 2005 8:20 pm

Re: Extended Menu

Post by n3n » Mon Jan 23, 2006 11:12 pm

Is it possible for each menu item to have another background image ?

Tnx


Locked

Return to “Open Source Products for Joomla!”