Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod Pro
- » MetaMod Pro General Support
- » Multiple Menu question
Multiple Menu question
Multiple Menu question
I have 6 templates on a site. Each template has a position called dropdown where the menu is suppose togo. The issues is I can create a rule that will remove the menu but if I create a second rule that "enables" a menu for a given template then that menu does not show up.
Each of them triggers for the templates are based on the menu item click on the main page menu. I am looking for a simple rule that would in sudo code do:
If ( menu link clicked == site2 ) {
1. goto site2
2. remove the main menu
3. display template foo and custom menu bar
}
if (menu link clicked == menu bar link 1){
1. goto site 1
2. remove menu bar
3. display template main
4. display main menu.
}
I purchased metatemplatepro so I am using the UI. I love the concept of event driven policy. I just hope that this policy can be writen.
Thanks in advance,
Actus
Re: Multiple Menu question
Hi Actus,
Good questions. I'm sure that something like this can be done - but the bad news is that MTP can't remove entire menus, at least not directly.
When you say you are "removing a menu" do you mean that you are using MTP to remove all the individual menu items? If so that's not quite the same as removing a menu... it would be better to find a way to just not display the menu module (which is a job for MetaMod, since it controls modules).
Second question: when you say "go to site X", what does that mean exactly? Is that something like going to a particular article or menu item?
You're talking about some kind of multi-site setup I think, where you have a main menu with links to "sub-sites". Each of those subsites might be based on a menu of its own.
So I'd suggest that you set up each different template for each different "site". In some templates you directly set the name of the menu that will be displayed (in the template manager). In other templates, you have to assign a menu module into a certain module position. In the latter case, you could do a minor edit on each of those templates, and change the name of the module position that is going to hold the main menu. So instead of a module position called "top" in each one of them, 1 could be called "top-site1", the next "top-site2" etc. In that way, you can assign a menu module into each of the different module positions, and each one will only appear in the template / site where it would be appropriate.
That solves the general problem of having the right module show up on the right page, and you don't have to go about disabling large numbers of menu items.
Do you think that could help?
Cheers,
Stephen
Re: Multiple Menu question
I figured out the problem. The problem was actually not with Metatemplatepro it actually was with the coder who designed the template. He hard coded the value of the menu into the template. LAZY LAZY LAZY people.
It turns out that What I wanted todo can be done with hard coding menus in the templates. I have to say that I am still impressed with this component.
Actus non Verbum.
Re: Multiple Menu question
metamodguy wrote:
Do you think that could help?
For my specific requirement it would get me a good portion of the way to where I need to be. However as I stated we are going to hard code menu references and call it a day. If I do not do it that way I have to rewrite part of the template.
With that said thanks for the feed back and I will most likely be back once I get into some more advanced policies.
Thanks
Re: Multiple Menu question
Something you might want to bear in mind is that you can set flags in the PHP of the SUCCEED and FAIL actions. You can then use these flags in other parts of the system, e.g. templates.
e.g. if you want to flag up that a particular event has happened, you could use this: define("SET_MY_TEMPLATE_1", 1);
Then, in your template you could write:
if ( defined( "SET_MY_TEMPLATE_1" ) ) {
...... some code or html here........
}
That way, that piece of code/template can be controlled by decisions made in the rule chain. This would also work within modules and components, as the MetaTemplate rule chain gets processed before any of this other stuff does.
Cheers,
Stephen
- Index
- » MetaMod Pro
- » MetaMod Pro General Support
- » Multiple Menu question
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5942
- Posts this week:
- 2
- User Info:
- Total Users:
- 7629
- Newest User:
- claudiabush9
- Members Online:
- 1
- Guests Online:
- 177
- Online:
- claudiabush9
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked