NetTalk Central

Author Topic: Can you tell if you are serving pages into someone elses frame.  (Read 3582 times)

MikeR

  • Sr. Member
  • ****
  • Posts: 265
    • View Profile
    • Email
If that makes sense let me try explain my problem

I have a clarion nettalk webserver.

I want it to run stand alone and send pages to the browser with headers foooters menus and main content. (the full monty)

I also want it to be embedded into another url in a frame.

If its being served inside the other site inside the frame I need to drop off the header and footer. I still want the menu buttons.
In some cases I want no header no footer and no buttons.

I hope that makes sense ?


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Can you tell if you are serving pages into someone elses frame.
« Reply #1 on: April 12, 2017, 05:38:26 AM »
Hi Mike,

the easiest approach is if the "embedded url" includes a parameter which you test for.
For example

www.capesoft.com/home.htm  <-- regular URL for browser

www.capesoft.com/home.htm?embedded=true  <--- use when embedding iFrame.

Then you can do a StoreValue to move it into the SessionQueue, and in the header and footer procedure put appropriate conditionals around your xHTML's.

Make sense?

If the parameter is not possible, then you could check the referer header on the server side, but that would be less reliable.

cheers
Bruce