We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

How to display a channel on an iframe on another site with all the header removed.

How Do I?

developer857's avatar
developer857
4 posts
8 years ago
developer857's avatar developer857

We currently have a channel displaying information. It is public and non-authenticated with a unique url for each record. It was requested to display this information on another site on our same domain in an iframe. How do I have the channel generate all the same information without the header and footers so I can place it in an iframe?

       
Ingmar Greil's avatar
Ingmar Greil
29,243 posts
8 years ago
Ingmar Greil's avatar Ingmar Greil

A channel is just a way to store and access your content, it doesn’t create headers or footers (or in fact any kind of layout), your templates do. If you want a minimalist template, just stick

{exp:channel:entries ...}{title}{/exp:channel:entries ...}

in one and take it from there.

       
dwg-andy's avatar
dwg-andy
27 posts
8 years ago
dwg-andy's avatar dwg-andy

If you have a template that you want to display both as it’s own page and also in an iFrame, and you don’t want to create two templates, then you can try checking if the page is in an iframe, then hide the header and footer of your page.

[removed]
if ( [removed] !== window.parent.location ) { 
   // The page is in an iframe
 //do some stuff to hide the header and footer elements
 } else {
  // The page is not in an iframe 
 }
[removed]
       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.