Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
Two navigation menus - click event?
Two navigation menus - click event?
Hello, I a really struggling with something and I've tried several extensions etc to also try get this done. I've even visited your forums and used some code suggested to another user which doesn't seem to work in my metamod module.
What I have is this...
I've got 2 menus, one main navigation menu for public visiters (logged out), and which also needs to display for logged in REGISTERED users. Then I have a second navigation menu for our composers - where they upload their music. I get the module to work with regards to which menus shows for particular user groups, but my problem is the articles shown on the HOME pages for each navigation menu.
What I do notice is that when a composer logs in, the "home" page is not highlighted (as it normally is when viewing as a public visitor or registered user). I have to first CLICK on the home page, then the correct article shows. Is there some sort of click event I can trigger to make this happen automatically?
Your assistance would be grealty appreciated!
Kind Regards
Lindy Botha
When the going gets tough, the tough gets going!
Re: Two navigation menus - click event?
Ok, that's a situation where MetaMod may not be the whole answer.
In your login module, you should be able to tell it which page to go to on login. Are you doing that? You should set the "Login Redirection Page" to the menu item that you want people to be sent to when they log in. If that's set correctly, the right menu item should be highlighted once they get sent to that page.
Cheers,
Stephen
Re: Two navigation menus - click event?
Hello, I have set it, but the problem is that I've got different types of users logging in, 2 actually to be exact, and they each have to see a different page once logged in. In the login module you can only set one page.
Thanks
Lindy
When the going gets tough, the tough gets going!
Re: Two navigation menus - click event?
Ah, I see what you mean. That is a bit more difficult. Would it work for you to have 2 separate login forms, 1 for each type of user, and try to encourage people to use the right form? Yeah, ok, not a great idea, but I thought I'd mention it.
A better way would be to get the login form to redirect to a "dummy" page that has a MetaMod on it. That MetaMod would detect the group of the user, and redirect them to the right page for that group. How does that sound?
So you could:
1 - set up a dummy menu item on a hidden menu, that points to nothing in particular (blank article or something - it probably won't be seen)
2 - edit your login module so it redirects to that page
3 - assign a MetaMod to that page that detects the 2 group types, and does a redirect.
Now I don't know what code you are using for detecting the groups, but here's what you can use for the redirect:
$app = &JFactory::getApplication();
$app->redirect("http://www.example.com/home_page_for_co … html");
I'm assuming you know how to build that in with your other PHP.
Hope that helps,
Stephen
Re: Two navigation menus - click event?
Hello,
I was hoping to put the redirect in the same metamod module I am currently using to detect which user it is, instead of having another separate module for the hidden menu. I also wonder if it's necessary to have another hidden menu, when I already have two menus, one called HOME and the other SUBMISSION GUIDELINES. Each one is the "home" page for that navigation menu, both publically visible.
The code I'm currently using in my metamod module is:
if ( MM_NOT_LOGGED_IN ) return 245;
if ($core_genius->check("groups = Registered")) return 245;
if (MM_USER_SUPER_ADMINISTRATOR) return 246;
This returns the correct navigation menu, depending on whether the user is logged out, logged in as registered user, or logged in as super administrator.
But I did what you said, I create a hidden menu linked to random article, then edited my login module to redirect to that hidden menu. I then create a new module with this code:
if (MM_USER_SUPER_ADMINISTRATOR) $app = &JFactory::getApplication();
$app->redirect("http://www.rhapsideemusic.co.za/en/subm … ines");
This does the same that it did before. It gives the correct navigation menu, but does not redirect to the article that should show for super administrators only. It still shows the article shown to registered and logged out users. And I have to click on the super administrator HOME page in order to see the correct article.
Thanks for your help so far.
Regards
Lindy
When the going gets tough, the tough gets going!
Re: Two navigation menus - click event?
Hi Lindy,
the PHP code is a little wrong. Try this:
$app = &JFactory::getApplication();
if ($core_genius->check("groups = super users")) {
$app->redirect("http://www.rhapsideemusic.co.za/en/subm … ines");
}
I think that will work better.
Cheers,
Stephen
Re: Two navigation menus - click event?
Ok, I've put this code:
$app = &JFactory::getApplication(); if ($core_genius->check("groups = super users")) { $app->redirect("http://www.rhapsideemusic.co.za/en/subm … ines"); }
and it still does not redirect. I have assigned the metamod to the dummy hidden menu linked to random article. What am I missing here?
Kind Regards
Lindy
When the going gets tough, the tough gets going!
Re: Two navigation menus - click event?
ok, I'm assuming that you are logging in to the front end with a super user's credentials in order to test this out. If you are doing that then something wrong with the rule. I'm going to test this out myself.
Just double check that the MetaMod on the dummy hidden menu is actually assigned to the right menu item, and published, and set to a valid module position.
Will get back to you to confirm the PHP...
Cheers,
Stephen
Re: Two navigation menus - click event?
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5942
- Total Posts Today:
- 1
- User Info:
- Total Users:
- 7621
- Newest User:
- musser4585
- Members Online:
- 1
- Guests Online:
- 126
- Online:
- musser4585
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked