Jump to content

Only show CMS content (not header, footer etc.) in iFrame


CrossY

Recommended Posts

Hi there,

 

I'm using an iFrame with this code (thanks to Vekia overlord):

add class="iframe" to your link (<a class="iframe">)
 
+ add this script
<script type="text/javascript">
	$('a.iframe').fancybox({
		'type' : 'iframe',
		'width':600,
		'height':600
	});
</script>

I'm linking to a CMS page. Would it be possible to show only the CMS content, and hide everything else such as header and footer? I could imagine I could use CSS 'hacks' to display: none on all other content, but I feel there may be a built in feature to establish this.

 

Thanks in advance,

Link to comment
Share on other sites

Fixed:

<a href="{$link->getCMSLink('8')}?content_only=1" class="iframe">link</a>

Replace '8' with whatever CMS page you want displayed (thanks to El Patron I believe).

The iframe didn't properly style it for me though (doesn't use the cms.css styling), especially an image that was too wide, fixed it like this:

.content_only {
  padding: 8px;
  color: #333;
}
.content_only img {
  max-width: 100%;
  height: auto;
}

 

Thanks, just fixed it a minute ago before your post ;) Hope this can help others in the future.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...