I seem to be missing something very important when developing my components. For instance I've created a simple event-calendar and when logged in you have the possibility to add items to the calender by clicking a link. This link goes to the same component but with a different view passed (&view=edit). When visiting this link Joomla interprets this as leaving the calendar menu option. I don't know if this makes any sense so I'll try with an example.
I've got the menu option "Calendar" and when viewing it the calendar shows up nicely and "Calendar" is marked as the active menu option. In the calendar view there is an option for logged in users to add events and when clicking the link the form to add events is shown but the menu option "Calendar" is no longer marked as the active menu option, in fact there is no menu option marked as active.
What is the correct way to do this? I've noticed that there is function to set the active menu option ( setActive($id) ) but how do I fetch and pass the correct menu-id to the new view? Is that the way you're supposed to do it?
J1.5 Component, different view but the same menu option?
Moderators: tjay, seadap, Rogue4ngel, matthewhayashida
- deepthoughts
- Joomla! Apprentice
- Posts: 12
- Joined: Tue Sep 27, 2005 1:12 pm
- Location: The northern part of Sweden (Piteå)
J1.5 Component, different view but the same menu option?
Stefan Nitsche
stefan_at_nitsche_dot_se
stefan_at_nitsche_dot_se
-
- Joomla! Apprentice
- Posts: 41
- Joined: Sat Dec 15, 2007 3:02 pm
- Location: Washington DC Metro
Re: J1.5 Component, different view but the same menu option?
Perhaps you are missing the hidden field with the component name on the page?
Code: Select all
<input type="hidden" name="option" value="com_yourcomponent" />
Denise