Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » Chameleon / ChameleonLite
- » ChameleonLite
- » Site Default menu Item with no effect
Site Default menu Item with no effect
Site Default menu Item with no effect
Dear All,
We have installed MetaTemplate and do have a slight problem.
While the template switching does work fine, it seems to be impossible to use a different frontpage with the Default Menu setting in the rule.
Up to now, we have created up to 3 rules. First puts the session variable, 2nd switches the template. So far so good.
If we put the Default Menu into either the 1st, the 2nd or another 3rd rule, there is no switch on the loaded page.
We found out that indeed the default menu is set to the desired value (via echo), but it actually doesn't do anything with it.
Can someone help?
System: joomla 1.5.15, CB installed
rules 1:
Code:
/* get hold of the "referer" string */
$ref = array_key_exists( 'HTTP_REFERER', $_SERVER ) ? $_SERVER['HTTP_REFERER'] : '';
if (substr($ref,0,23) == 'http://www.xxxxxxx.de') {
return true;
}
The goal is to have different frontpages, depending on certain referrers.
10-Sep-10 10:33:44
Re: Site Default menu Item with no effect
Hi,
This is an interesting situation. I can think of 2 things that might be going on.
1 - I want to explain exactly what the changing the default menu item does. When you change this, it simply changes which menu item is used when someone goes to your site and specifies no particular page, e.g. http://www.example.com/
This is the same as what happens when you change the "default" menu item using the menu manager. It doesn't change the order of the menu items, and it doesn't change what page people see when they click on "Home". "Home" (if you have a menu item called that, as most people do), will still always point you to whichever menu item it was set to, e.g. the "frontpage" component. In fact, if you change the default from "Home" to something else, then "Home" will still be the first item on your main menu, but going to www.example.com/ will just take you to a different page. If someone then clicks on "Home", they'll see a different URL, e.g. http://www.example.com/ / index.php?option=com_content&view=frontpage&Itemid=1.
Can I suggest that you check to see whether this is what's actually happening? Unless there's something else going on, then this is the way it's supposed to work. The system is not smart enough (yet!) to actually re-order the menu items, or to re-assign the "Home" menu item to something else.
2 - If you understand (1), but even that is not working, then I guess there's some other component that's getting in the way. Perhaps there's a menu module (or menu built in to the template) that queries the database directly for the Menu structure, rather than taking it from JMenu.
If you like, I could take a look around your site (require admin access) to see what's going on. But I have feeling that the probably may be just a misunderstanding of what the feature actually does, i.e. (1).
Best regards,
Stephen
Re: Site Default menu Item with no effect
Hi Stephen,
Actually I think that you describe the problem 100% correct.
It might indeed be a misunderstanding of the features, although I need to admit that I am not getting fully behind the idea of changing the default menu item in this case....
However, According to some threads I had found regarding the "multidomain" hack of a joomla 1.0 system, I think there a quite some people out there, who really need to call also for a specific "frontpage".
I am not doing exactly this multidomain thing, but a bit similar as we are using the http_referer info to determine the look and feel of our site.
Problem is that is required to also call a specific "start" page, corresponding with the various templates. We might call it a customized frontpage.
The easiest way was our thought to "change" the frontpage dynamically. Would be a pity if it doen't work this way.
I was trying to play a bit with the redirect feature, but that surprisingly let us into a loop where always the set page was called, no matter which menu item you have clicked. When we also deleted the session variable within the last rule, it made us simply go back to the old template.....
What i simply want to do is to call at last one specific article/document as some sort of a landing page.
Any ideas are highly welcome!
Best rgds
Jens
Re: Site Default menu Item with no effect
Please have a look at http://www.steenfadt.de/
on the frontpage there is a link to the mycharter24.de website.
Now what happens is if you go through this link, the template will be changed from the normal one.
But still, it will call only the frontpage as usual. what I want is to have just another page shown.
Re: Site Default menu Item with no effect
Ok, I had a thought about this. Maybe this might do what you want it to, though i'm describing the situation in general terms:
1 - because the "Home" button is normally a component, e.g. the "front page" view, changing the "default" menu item doesn't work very well for your purposes. This is because the "Home" button is still going to take you to the same page as before, no matter which menu item is "default".
2 - so, change the "Home" button from a component link to a URL link. The URL can be the http://www.example.com/, or just "/". That way, clicking on "Home" will always take you to the page that's *actually* set up as "default".
3 - then, set up MetaTemplate to detect referer1. If referer1 is found, then set session variable 1.
4 - in the second rule, detect session variable 1, and if found set template1 and change the default menu item to "alternative1" (then stop processing rules).
5 - add pairs of rules like that for each different template/referrer you want to set up.
6 - finally, make sure that you actually have a sensible "default" menu item (in the menu item manager) that will be used when people go directly to http://www.example.com/. This may not be in the main menu that you display at the top of your pages - it may be a menu item on a different menu altogether.
So what happens is this:
- user goes direct to http://www.example.com/. Falls through all the MetaTemplate rules (no referrer found; no session variables set), and uses the default menu item for the front page.
- if user clicks on "Home" which goes to http://www.example.com/, they still see that same front page.
- user visits www.referrer.com and clicks through to your site
- referrer is picked up by MetaTemplate; session variable is set, template is set, and default is set to "alternative page 1". This alternative page displays is used when the user goes to "/".
- clicking on "Home" remains on this page, because the session variable remembers the decision from earlier.
The only down side of this system is that if you have "active menu highlighting" in your template, then it's probably not going to show up the active menu when you're on the front page - because "Home" is a URL not a component, and the "real" front page may be on a different menu altogether.
I have to say, this is a really interesting use and solution with MetaTemplate!
Best regards,
Stephen
Re: Site Default menu Item with no effect
Hm, the way you describe it, we have done it.
1st rules is detection of the referer. 2nd rule sets the template and sets the default menu item to the first menu item in the menu used in this template. There is no home button so far.
So, we might indeed have another issue?
Re: Site Default menu Item with no effect
I can only imagine that there's some setting that's causing one of the rules to fail. If you like I can log into your site and take a look - it's probably something simple! I'll PM you my e-mail address.
Cheers,
Stephen
Re: Site Default menu Item with no effect
I just cant get this to work
Normal domain: http://www.shenandoahclinic.com/
Special domain: http://ftp.shenandoahclinic.com/
Here is my rule setup: http://screencast.com/t/LvblC61Dchxa
You will see that the rule IS working BUT the default menu item is NOT working.
If you go to the special domain above, it's showing the echo saying the test works and you're just going to "/" so it should use this custom default menu... I just can't get it to do that!
It's Joomla 1.5.18. Help?!?
I will happily buy pro if you can get this working for me.
Re: Site Default menu Item with no effect
Hi jclamp,
Hmmm, yes, this definitely looks like it's not working.
Can I ask for clarification on 2 things:
1 - version of MetaTemplate you are using
2 - what type of SEF component you are using. Are you using standard Joomla SEF, or sh404SEF or similar?
Cheers,
Stephen
- Index
- » Chameleon / ChameleonLite
- » ChameleonLite
- » Site Default menu Item with no effect
Board Info
- Board Stats:
- Total Topics:
- 1699
- Total Polls:
- 6
- Total Posts:
- 5965
- Posts this week:
- 4
- User Info:
- Total Users:
- 8011
- Newest User:
- ignac84502
- Members Online:
- 0
- Guests Online:
- 126
- Online:
- There are no members online
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked