Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

Metamod and iframes

Metamod and iframes

Hi all!
I don’t really know if what I’m trying to do is possible.
I have built a joomla site and I need it to be shown in other sites inside an iframe. This is the easy part...
The hard one is that I need some modules to be visible if the site is accessed directly and to be invisible if the site is accessed inside the iframe!
Metamod solved me a lot of other problems so I thought: “This is a great extension and it’s going to solve me this one to. Easy... easy...”
big_smile

Sorry my english and thanks

Edited By: almeidaniel
25-Mar-10 10:22:15

almeidaniel
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Re: Metamod and iframes

Hi almeidaniel,

That's surprisingly difficult to do.

One thing that you can do is to change the link that you use for the item in the iframe. e.g. if your iframe contains "www.mysite.com/start", then change it to "www.mysite.com/start?iframe=1". Then in a MetaMod on that page of your site you can detect the frame with ... and JRequest::getVar("iframe") == "1"

However that's only going to work for the first page. As soon as someone follows an internal link inside the iframe, then you'll lose that variable. So if you know how, you can set a session variable or cookie and "remember" the fact that it's in the iframe, for the rest of the session.

Even that's not perfect, because if the user breaks out of the iframe, your site won't be able to tell the difference. So there's actually no perfect way for Joomla to know that the page it is displaying is inside an iframe. You can only do your best smile

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3312 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1667
Total Polls:
6
Total Posts:
5909
Posts this week:
1
User Info:
 
Total Users:
10137
Newest User:
lexispoker1
Members Online:
1
Guests Online:
295

Online: 
liaskas

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked