Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » Chameleon / ChameleonLite
- » Chameleon
- » Frames
Frames
Frames
Well this one is a hard one ! For me at least !
Let's say that I have a redirection by frame from a domain 1 to a domain 2 which hosts my joomla website.
I would like metatemplatepro to switch template when I detect that the user targeted domain 1. However I cannot find a referer and getting the host does not work as domain 2 is in the iframe.
The only thing that I get is the page title which is always the domain 1 name and this:
Code:
<HTML>
<HEAD>
<TITLE>domain 1</TITLE>
</HEAD>
<FRAMESET ROWS="*,0">
<FRAME SRC="http://domain 2/fr/shop" NORESIZE>
<NOFRAMES>
Your browser does not support frames.
</NOFRAMES>
</FRAMESET>
</HTML>
I tried with referer, domain name but no luck so far.
I wanted to try to detect the page title but don't know how to do it as it seems to me that metatemplate would detects a title within the iframe.
Any ideas ?
Re: Frames
At this stage I really have no idea how you might go about this. Can you not do it with an iframe instead, since you got this working on the other site with the HTTP_REFERER variable?
On the "included" site you could try to put a print_r($_SERVER) in MetaTemplate's PHP box. The output will come out before the page is started (which is why there's no debug mode in MetaTemplate), but hopefully you'll get to see that output in the "frame". There might be another $_SERVER variable there that gives some clue as to whether it's in a frame or not.
Best regards,
Stephen
Re: Frames
I just thought of something -- you could add an extra URL parameter on to the URL in the frame, then use MetaTemplate Pro to detect this URL and set a session variable.
I guess the only problem with this is that the search engines will probably index that internal URL. That's not good. I suppose you could detect the user agent for common robots (googlebot) and NOT set the session variable for them. At least that way they won't index the wrong content from the front page onward, but you still have the problem that they've indexed the URL with the parameter.
So... perhaps do a 301 redirect if you detect a googlebot and the parameter is set (so it won't index that URL); otherwise, set the session variable and template and continue as normal.
Just a thought.
Stephen
- Index
- » Chameleon / ChameleonLite
- » Chameleon
- » Frames
Board Info
- Board Stats:
- Total Topics:
- 1700
- Total Polls:
- 6
- Total Posts:
- 5967
- Posts this week:
- 3
- User Info:
- Total Users:
- 8056
- Newest User:
- no21an
- Members Online:
- 0
- Guests Online:
- 165
- 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