How to have an iframe included with automatic height/width
How to have an iframe included with automatic height/width
I have used the {pi_iframe}-tag and see that the height of the iframe isn't reflecting the height of the page that is included. Is there a way to have the iframe to show without the scroll-bars and have the full height of the page included. I now gave a fixed height of the max height used, but if the page is not that heigh, you'll end up with a lot of whitespace below the content. I basically want the frame to behave like normal content, so flexible in height and no scrollbars.
Ronny
Ronny
-
cyberman
Re: How to have an iframe included with automatic height/width
Embed tag (provided with default CMSms install) has such an option ... please look at tag help.
Re: How to have an iframe included with automatic height/width
Cyberman,
i had tried the embed-tag, but that didn't work as well. I entered the "header=true"-part in the metadata of the content-page, but the iframe didn't go down, it only extends to the height of the menu/sidebar.
I'll create another page with this logic and will post the link to see..
http://work.krijt.eu/index.php?page=beach-lot-embed
Template now:
Metadata of page:
Content of page:
While page www.nu.nl is longer than is just shown in the calling of the embed-tag....
Ronny
i had tried the embed-tag, but that didn't work as well. I entered the "header=true"-part in the metadata of the content-page, but the iframe didn't go down, it only extends to the height of the menu/sidebar.
I'll create another page with this logic and will post the link to see..
http://work.krijt.eu/index.php?page=beach-lot-embed
Template now:
Code: Select all
{metadata}
<!-- Don't remove this! Metadata is entered in Site Admin/Global settings. -->
Code: Select all
{embed header=true}
Code: Select all
<p>{embed url=http://www.nu.nl}</p>
Ronny
Last edited by RonnyK on Wed Jun 13, 2007 7:50 am, edited 1 time in total.
Re: How to have an iframe included with automatic height/width
Ronny,
I tried something similar with a UDT:
It is possible to use
Does this help?
Gregor
I tried something similar with a UDT:
Code: Select all
echo '<__iframe width="100%" height="265" frameborder="0" src="poll/demo_1.php"></__iframe>';www.wsv-herkingen.nlheight="100%"
Does this help?
Gregor
Re: How to have an iframe included with automatic height/width
Gregor,
can you show me the way your UDT looks, and the calling of the page. I tried to put iframe directly in the content-page, but it still doesn't show the entire height.
Ronny
can you show me the way your UDT looks, and the calling of the page. I tried to put iframe directly in the content-page, but it still doesn't show the entire height.
Ronny
Re: How to have an iframe included with automatic height/width
Of course
I put {poll} in the template.
Gregor
I put {poll} in the template.
Code: Select all
</div>
<!-- End Content Area -->
</div>
<!-- End Content -->
<!-- en nu de rechterkant maken voor de content -->
<!-- 19-03-07 toegevoegd -->
<div id="rightcontent">
{content block='Rechter content'}
{poll}
<!-- Adsense van Google toegevoegd op 16 apr 2007 -->
{adsense ad_client="pub-3514636835854223" ad_width="120" ad_height="240" ad_format="120x240_as"}
</div>
<!-- Start Footer. Edit the footer in the Global Content Block called "footer" -->
-
alby
Re: How to have an iframe included with automatic height/width
There is a smarty error in a javascript in header:RonnyK wrote: Cyberman,
i had tried the embed-tag, but that didn't work as well. I entered the "header=true"-part in the metadata of the content-page, but the iframe didn't go down, it only extends to the height of the menu/sidebar.
I'll create another page with this logic and will post the link to see..
http://work.krijt.eu/index.php?page=beach-lot-embed
Template now:
Metadata of page:Code: Select all
{metadata} <!-- Don't remove this! Metadata is entered in Site Admin/Global settings. -->Code: Select all
{embed header=true}
Code: Select all
string(372) "Smarty error: [in metadata template line 7]: syntax error: unrecognized tag: //find the height of the internal page
var the_height=
document.getElementById('the_iframe').contentWindow.
document.body.scrollHeight;
//change the height of the iframe
document.getElementById('the_iframe').height=
the_height; (Smarty_Compiler.class.php, line 439)"
string(116) "Smarty error: [in metadata template line 7]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 583)"
<meta name="Generator" content="CMS Made Simple - Copyright (C) 2004-6 Ted Kulp. All rights reserved." />
Alby
Re: How to have an iframe included with automatic height/width
Alby,
thanks for checking, I was "playing" with some height-scripts. I now have embedded the page I want to include, that is NOT working, but with the test-page I tried, www.nu.nl I noticed that the embed, as the other scripts, don't go "all the way down". I now included the good page, which luckily for me, is not as big is the nu.nl page.
http://work.krijt.eu/index.php?page=nu-nl
shows that it is not the full page that www.nu.nl shows original.
The CSS for the iframe:
Ronny
I now see that the other page isn't working either as the default is something like 600px. The page is bigger.
thanks for checking, I was "playing" with some height-scripts. I now have embedded the page I want to include, that is NOT working, but with the test-page I tried, www.nu.nl I noticed that the embed, as the other scripts, don't go "all the way down". I now included the good page, which luckily for me, is not as big is the nu.nl page.
http://work.krijt.eu/index.php?page=nu-nl
shows that it is not the full page that www.nu.nl shows original.
The CSS for the iframe:
Code: Select all
#myframe {
height: 100%;
}
I now see that the other page isn't working either as the default is something like 600px. The page is bigger.
Last edited by RonnyK on Wed Jun 13, 2007 10:02 am, edited 1 time in total.
Re: How to have an iframe included with automatic height/width
IIRC there is a problem with iframes from different domains. JS security options disable doing too much to the content of iframe if the source is not on the same domain, including the height query.
last time I had to do something like this it couldnt be done (but that was like two years ago)
last time I had to do something like this it couldnt be done (but that was like two years ago)
Re: How to have an iframe included with automatic height/width
I did a test with
http://www.wsv-herkingen.nl/index.php?page=nu
I put a UDT {nu} with the following code
in the template. The site nu.nl can bescrolled inside the page area (not on the correct place, have no time to solve that one).
Does this help?
Gregor
http://www.wsv-herkingen.nl/index.php?page=nu
I put a UDT {nu} with the following code
Code: Select all
echo '<__iframe width="100%" height="100%" frameborder="0" src="http://www.nu.nl"></__iframe>';Does this help?
Gregor
Last edited by Gregor on Wed Jun 13, 2007 11:02 am, edited 1 time in total.
Re: How to have an iframe included with automatic height/width
Gregor,
that is exactly my issue, i would expect no scrollbar, with the height=100%, I wanted the height to be as high as required.
Ronny
that is exactly my issue, i would expect no scrollbar, with the height=100%, I wanted the height to be as high as required.
Ronny
Re: How to have an iframe included with automatic height/width
Ronny,
OK, that's the point. What I did to solve it at the wsv-site, I made the iframe area a little larger (in the template). However, if this is not going to work because of the size of the page you want to include, maybe this might help:
http://www.thescripts.com/forum/thread145283.html
I add
Gregor
OK, that's the point. What I did to solve it at the wsv-site, I made the iframe area a little larger (in the template). However, if this is not going to work because of the size of the page you want to include, maybe this might help:
http://www.thescripts.com/forum/thread145283.html
I add
to the iframe code and now it has no scrolling abillities. I only see a part of the nu.nl-site, might that have to with the site desing of nu.nl???scrolling="no"
Gregor
Last edited by Gregor on Wed Jun 13, 2007 11:35 am, edited 1 time in total.
-
cyberman
Re: How to have an iframe included with automatic height/width
It's much more tricky, but another way could be to rip content of page you wanna include via php like I've try it here
http://test.cmsmadesimple.de/index.php?page=estate-page
(Yes, I know - all links are broken and page is not valid, but it's only a simple working draft
.)
http://test.cmsmadesimple.de/index.php?page=estate-page
(Yes, I know - all links are broken and page is not valid, but it's only a simple working draft
Re: How to have an iframe included with automatic height/width
oops, Cyberman, the link dos not work at all 
Re: How to have an iframe included with automatic height/width
Thanks Cyberman,
I'll check that. The only quick disadvantage of that method I see is that links that are clicked in the page "included", are not linkable, as they link relatively, so to your own page instead of remaining inside the iframe/embed.
Ronny
I'll check that. The only quick disadvantage of that method I see is that links that are clicked in the page "included", are not linkable, as they link relatively, so to your own page instead of remaining inside the iframe/embed.
Ronny


