Page 1 of 1

Adding id="active_t_menu" to Top Menu?

Posted: Sun Sep 18, 2005 1:00 am
by Pesto
Hi.

I want to achieve the same active state for links that are duplicated in the Top Menu and the Main Menu.

I know Main Menu puts in  id="active_menu" for the section you are on. How do I get Top to follow suit?

Thanks

Pesto

Re: Adding id="active_t_menu" to Top Menu?

Posted: Wed Oct 12, 2005 3:09 pm
by kai920
Hi would like to know this too... want to emulate Joomla's tab menu, for example FORUMS is highlighted right now.

What's the easiest way to achieve this with the included madeyourweb template?

Re: Adding id="active_t_menu" to Top Menu?

Posted: Wed Oct 12, 2005 9:50 pm
by de
The id="active_menu" is assigned to the menu item which is currently selected (according to the Itemid parameter)... it doesn't matter which menu module it is... but they would need to show the same menu somehow. See the thread about my extended menu:
http://forum.joomla.org/index.php/topic,10389

TomT did what you are probably interested in. (The fix I send just him is not needed if you set in the module parameters the menu type to "Tree List").
(There is also another thread... just don't have the link handy)

Edit: here is the other thread: http://forum.joomla.org/index.php/topic ... cseen.html

Re: Adding id="active_t_menu" to Top Menu?

Posted: Thu Oct 13, 2005 1:51 am
by kai920
Thanks for the reply, I'll give your module a go and see if it helps  8)

Re: Adding id="active_t_menu" to Top Menu?

Posted: Fri Oct 14, 2005 6:30 am
by kai920
de:

I downloaded your module, haven't really had time to play with it, but upon changing the topmenu to mod_exmenu, my menu is displayed vertically and is not aligned? 

Also would you mind sending me the "fix"? thanks.

Re: Adding id="active_t_menu" to Top Menu?

Posted: Fri Oct 14, 2005 11:03 am
by de
kai920 wrote: I downloaded your module, haven't really had time to play with it, but upon changing the topmenu to mod_exmenu, my menu is displayed vertically and is not aligned? 

Also would you mind sending me the "fix"? thanks.
The menu style defaults to "Vertical" (not because it is preferred, but just to behave as the builtin mainmenu module by default).
Look at the menu style of your previous (unpublished) topmenu menu module... it is probably set to "Horizontal" or "Flat List"... if it is the later, then just set the menu style to "Tree List" and "Split Menu" to "1"... that way you don't really need the fix.

If you really think you need the fix anyway... email me and I reply with it. (One day I will probably take the time to configure CVS/SVN properly)

Re: Adding id="active_t_menu" to Top Menu?

Posted: Fri Oct 14, 2005 4:18 pm
by kai920
ok, i changed "menu class suffix" to -nav and that solved the issue of my menu not displaying horizontally...

now to re-read the links you gave me to try to figure out how to keep the menu items highlighted :)

Re: Adding id="active_t_menu" to Top Menu?

Posted: Wed Nov 09, 2005 12:56 am
by suthram
Guys,

Since you have played a lot with the extended menu, I have a question:

I have many sub level items and I want my menu to be such that, if I click on a child of a parent menu item, the page refreshes to show the target page with only the children items in the navigation.  I do NOT want the parent items to show as they would in a regular menu.  So for example, if I have:

Home
Fruit
  Apple (slideout)
  Orange (slideout)
  Banana (slideout)
  Kiwi (slideout)
Vegetable
Contact Us

And I click on "kiwi", then the "Kiwi" page loads and the menu will be:

Apple
Orange
Banana
Kiwi
Kiwi 1 (slideout)
Kiwi 2 (slideout)
Kiwi 3 (slideout)

The parent items disappear.

Similarly, if I now click on "Kiwi 1" then, the page reloads to go to "Kiwi 1" page and the menu becomes:

Kiwi 1
Kiwi 2
Kiwi 3

I know this is easy to do with only one parent level and one child level.  I have as many as 6 levels of submenu items.  Please advise on how I need to tweak the "Extended Menu" to operate as such.

Thank you!
Suthram

Re: Adding id="active_t_menu" to Top Menu?

Posted: Wed Nov 09, 2005 3:09 pm
by de
Hi Suthram,

I may add such an option in a future version (not sure yet)...
What you could do at the moment is to have three modules... for the second module you set "Begin With Level" to "1", for the third module you set it to "2"... and then you set the first module to show on the mainlevel items (Home, Fruit, Vegetable, Contact Us) and the second to show on the 1st sub level menu items (Apple, Orange, Banana, Kiwi, ...) and the third to show on the 2nd sublevel menu items (Kiwi 1. ...)
That may be too much work for large sites though.

I hope that helps,
Daniel

Re: Adding id="active_t_menu" to Top Menu?

Posted: Wed Nov 09, 2005 4:06 pm
by suthram
Thank you for the fast response, Daniel.  I will look into this and see what I can do.

I have about 7 levels.  What do you think about this? :-

If I have 4 levels, I can make a copy of the extended menu module - let's call them exmenu1 and exmenu2.  I could have exmenu1 begin at level 1 and have it create another module within the menu to show level 2 items only.  Then, I could have exmenu2 to start at level 3 and have it create another module within the menu to show level 4 items only. And so on and so forth ...

I could have exmenu1 publish only on the pages with correspond to level 1 and 2 items.  And similarly, have exmenu2 publish only on the pages corresponding to level 3 and 4 items so that the two exmenus never overlap across pages.

I hope I'm making sense.  Please let me know if there is another menu module out there that I can use.  Thanks.

Pradeep

Re: Adding id="active_t_menu" to Top Menu?

Posted: Wed Nov 09, 2005 7:25 pm
by de
Yes, I think you understood what I was trying to say... with 7 levels and each having probably a few items that seem like a good bit of work.

I am sorry, but I don't know the other menu modules that well... Infinity, SWMenu and Lxmenu seem to be some of the good... but whether they are able to provide what you are looking for.

Re: Adding id="active_t_menu" to Top Menu?

Posted: Wed Nov 09, 2005 11:03 pm
by irstudio
hi

basically i have been meaning to hack this in myself
should be fairly simple

like you said, it uses id="active_menu"
the downside is that each id is unique so there can be only one

so changing the code to produce class="active_menu"
and then changing all '#active_menu' to '.active_menu' in the css would be a good start

you could then make multiple items active

I personally want to make a tab menu across the top
and have a menu per each tab and make the tab stay active
(even after you click on a menu item in the 'left' position)
without having to make a custom template per tab (which is what the joomla site is probaly doing)

Re: Adding id="active_t_menu" to Top Menu?

Posted: Thu Nov 10, 2005 12:15 am
by de
Ok, I did not understand that you planned to hack it by yourself.

About the active_menu id... that I already built in... it uses mainlevel_active/sublevel_active.

For the other request... you could of course try to hack my menu module... almost in the end (1428) you will see a line like this:

Code: Select all

$menuNode	=& $menuLoader->menuNodeByIdMap[$menuLoader->activeIds[$key - $depthIndex]];
If you make a similiar call at the right place like this:

Code: Select all

$menuNode	=& $menuLoader->menuNodeByIdMap[$menuLoader->activeIds[1]];
than it should show something like you requested.

$menuLoader->activeIds is an array with the menu items on the path to the current menu item (currently starting with the current menu item).

I will most certainly add a parameter to the module to allow such behavior... I just don't know when. If you decide to donate to a charity or me it may influence my time scale :P

Re: Adding id="active_t_menu" to Top Menu?

Posted: Wed Nov 16, 2005 4:59 am
by de
The just released version 0.3.1 has the parameter "Begin With Current Item Level" which may be used for this purpose.
(I am just not sure that it gives a good user experience... you may also want to make use of "Show Parent")

Re: Adding id="active_t_menu" to Top Menu?

Posted: Wed Nov 16, 2005 4:30 pm
by suthram
Fatal error: Call to undefined function: getnulldate() in /usr/www/users/picnet/clients/harbour/modules/mod_exmenu.php on line 152
Daniel,

I installed your latest version of the extended menu and it resulted in this error on the frontend.  Are there certain parameters for which it is compulsory to declare a value?

- suthram

Re: Adding id="active_t_menu" to Top Menu?

Posted: Wed Nov 16, 2005 4:43 pm
by de
suthram wrote:
Fatal error: Call to undefined function: getnulldate() in /usr/www/users/picnet/clients/harbour/modules/mod_exmenu.php on line 152
Daniel,

I installed your latest version of the extended menu and it resulted in this error on the frontend.  Are there certain parameters for which it is compulsory to declare a value?

- suthram
Hi Suthram,

I guess I lost compatibility with previous Joomla/Mambo versions... I don't know since when that function is available. But upgrading to the latest Joomla 1.0.3 should solve that problem. (Alternatively you could modify the file to use '0000-00-00 00:00:00' in place... in a future release I will restore backward compatibility)

Daniel

Re: Adding id="active_t_menu" to Top Menu?

Posted: Mon Nov 21, 2005 9:57 pm
by suthram
Daniel,

Great news!  I got the menu item to work with your modified extended menu module.  It looks great and it does the job perfectly!  Thank you for all your work.

Suthram

menu shows "child items" at same level as "parent" upon clicking on "child"

Posted: Thu Mar 09, 2006 6:21 pm
by reneeccski
de, your extended menu module is very handy.  I'm having a bit of trouble figuring out how to do the following, however.  I am using the "top menu"  module for my site and the extended menu appears in the "left" position. 

Here is what currently happens:

1.  click item in the top menu
2.  left menu opens and shows all child items as expected
  Ex.
Parent item 1 (top menu item)
  • Child 1
  • Child 2
3.  Click on "Child 1"
Menu displays like this:

Parent item 1 (top menu)
  • Child 1
  • Child 2
Child 1

How do I make is so when I click on "Child 1" it does not appear at the same level as "Parent 1?"  I want the menu to appear always like my example in step 2.  Please let me know if this description is unclear.

Joomla 1.0.5
Extended Menu 1.0.2 

Extended menu settings:

Menu Class Suffix:
Module Class Suffix:
Enable Cache: no

Menu name: topmenu
Source Type: Menu
Source value:
Show section: default
Show category: default
Show content item: default
order: ording (asc)
default itemid:

Menu style: css tree
menu view plugin name:
show menu icons: no
expand menu: yes
expand until level: 2
maximum depth: 10
hide first entry: no
show parent: yes

parent menu item:
begin with current item level: no
begin with level: 1
split menu: 1
menu count: 2
enable query cache: no

parse access key: strip markup
link title: yes
level class: default
active menu class: no
element id: no
enable menu template: yes
template name: menu.html

skipping images section.....

select list submit text: go
hide submit button: never

skipping misc....

Re: menu shows "child items" at same level as "parent" upon clicking on "child"

Posted: Sun Mar 12, 2006 3:30 am
by de
reneeccski wrote: How do I make is so when I click on "Child 1" it does not appear at the same level as "Parent 1?"  I want the menu to appear always like my example in step 2.  Please let me know if this description is unclear.
I think in your case the module parameters "Split Menu" and "Menu Count" are cousing it (mainly the first)... they cause it to split the menu within the same module and hence starting with the first level again.... set "Split Menu" to something high (or empty should probably work too).

I hope that helps.

Re: Adding id="active_t_menu" to Top Menu?

Posted: Sun Mar 12, 2006 9:52 pm
by reneeccski
Thanks, de.

You are right about the split menu being the problem.  We changed it from 1 to 2 and it now works great!