Problem using an iframe

Author Message

Maarten Holland

Wednesday 31 March 2004 12:25:01 am

Goodmorning!

Unfortunately I have to use an iframe in my new site. The main pagelayout consists of 3 parts: One header on top, at the left side some buttons and next to that my main content.

I need to put the main content in a frame, so that users can scroll the content, and the header and buttons stay visible (don't scroll). Therefore, I've tried the following code in pagelayout.tpl:

      <TABLE border=0 width=1000 height=580 cellpadding=0 cellspacing=0>
      <TR>
        <TD colspan=2>
	  {include uri="design/support/override/templates/page_header.tpl"}
	</TD>
      </TR>
      <TR>
        <TD width=285>
          {include uri="design/support/override/templates/page_buttons.tpl"}
        </TD>
        <TD height=100% valign=top>
	  <iframe src="design/support/override/templates/frametest.php" width=600 height=500></iframe>
        </TD>
      </TR>
    </TABLE>

I've tried several things in stead of 'frametest.php', things like tags, tpls etc. Unfortunately ít keeps repeating my mainpage in the iframe. When I use a external URL it works fine.

Can anyone help me to get my result content in the iframe?

Thanks in advance,

Maarten

Alex Jones

Wednesday 31 March 2004 6:08:36 am

Maarten, you may need to set up a secondary 'site' which has a plain design (it doesn't include any of your headers, nav etc.). This site will display all of the same content as your normal site, just without the design. Then you can call the plain version of a page for your iframe.

That's if you really really really want to use an iframe. If, on the other hand all you want is the ability to keep your header and navigation visible while the content is scrolled, you can solve the problem with CSS, avoiding the iframe altogether. This has the bonus of improving the searchability of your site as well. But, to do this, you will have to sacrifice 4.x browsers, which had poor iframe support anyway. If you are willing to go the CSS route. Check out these two links, and try searching for 'position: fixed' via Google. :)

http://www.beforethedog.com/tutoriali/tut1.htm
http://devnull.tagsoup.com/fixed/vertical.html

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Maarten Holland

Wednesday 31 March 2004 6:56:11 am

Thank you very much! I did not want to use an iframe, it was just my poor solution for keeping the header static, because I didn't know this could be done using CSS.

You just offered me the solution I was searching for 3 weeks. Already got it working by using the following div:

#scrollcontent
{
width: 700;
height: 400;
background-color: #FFFFFF;
overflow: auto;
}

Thank you very much for taking the time to reply!

Alex Jones

Wednesday 31 March 2004 7:06:56 am

Glad to hear it. :) CSS is good.

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

poon sg

Tuesday 03 August 2004 11:14:11 pm

Hi :
I really want to use iframe, and i have created two site as Alex said, and I can use the iframe to display well, but my problem is that: my left side is navigator, when i click the navigator, the content can't display in the content area.
could somebody give me some advice?
Thanks!
sgpoon

Alex Jones

Wednesday 04 August 2004 8:43:46 am

sgpoon, do you want the link listed in your left side navigator to show up in the iframe, or do you want it to replace the iframe?

Alex
bald_technologist on the IRC channel: #eZpublish
http://www.agrussell.com :: http://www.cuttingedge.com

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

poon sg

Thursday 05 August 2004 6:08:11 pm

Alex:
Yeah, I want the link listed in my left side navigator to show up in the iframe.
sgpoon

poon sg

Sunday 08 August 2004 6:37:36 pm

Hi Alex:
Could you give me more details? I want the link listed in my left side navigator to show up in the iframe.

Thanks!
Sgpoon

Alex Jones

Monday 09 August 2004 1:27:42 pm

Sorry for the delayed response, I haven't had a lot of time to spend on the boards of late. I would recommend that you create a template override file for the link template and apply it to the page(s) that will contain the iframe. That will allow you to specify the link's <i>target</i> within the link override template so it populates the iframe.

Does that help?

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

poon sg

Wednesday 11 August 2004 12:15:54 am

Alex,
Thanks for your reply. But I still don't have a good idea to salve the problem.

In my pagelayout.tpl,top is my company logo and top menu, the below_left is navigator, and the below_right is content area; pls see code:

.......
{*below_left navigator*}
<h3>Navigation</h3>

{let sub_menu=treemenu($module_result.path, $module_result.node_id,

array('folder','info_page'), 1, 10)}
<ul >
{section name=Menu loop=$sub_menu}
<li class="subdirectory_{$:item.level}" > <a href={$:item.url_alias|ezurl}>{$:item.text}</a></li>
{/section}
</ul>
{/let}



{* below_right content area *}

<div style="width:75%; float:right; border-left:1px dashed red; border-bottom:1px dashed red">

{$module_result.content}

{*<iframe scr="http:/localhost/index.php/content" >
</iframe> *}

</div>

My problem is that When I click a linked Html file in content area, I want it pop up in the same page at the content area, not pop up is a new page, what can I do? use iframe or frame? Or anothe way?

and now, I've put the {$modeul_result.conent} is a new site, use iframe to link it, but i still can't find a way to make the below_left to link with belew_right,in other words, when i click the navigator , I want it dispaly the content in the below_right.

any help?

Thanks!
sgpoon

 

Alex Jones

Thursday 12 August 2004 8:54:44 am

Ahhh, I see the problem! What you need isn't directly related to eZ code. :) You need to use the <i>target</i> attribute of the anchor tag to tell the page where to load your content. Makre sure you assign a name to the iframe (<i><iframe name="contentarea"</i>) and then add the target attribute (<i>target="contentarea"</i>) to your anchor tag.

Check out these resources on how to specify the proper target:
http://www.w3.org/TR/REC-html40/present/frames.html (check out 'Specifying target frame information')
http://webmonkey.wired.com/webmonkey/96/37/index2a.html?tw=authoring
http://www.cs.tut.fi/~jkorpela/html/iframe.html

Hope this helps!

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

poon sg

Friday 13 August 2004 1:39:41 am

Alex:
Thanks a million!

I tried as you said, I assigned a name to the iframe, but how can I add the target, like this <a href="http://localhost/index.php/in_test" target="iframe">content</a>, am i right? but it's also can't give me the right present, and added a more line--<i>content</i> in the navigator area.

And I also tried to create another site, and let it only display navigator, and add the target to it, but it still can't ok.

You know if I don't set iframe, the treemenu($module_result.path, $module_result.node_id} automatic connect with {$modeul_result.conent}, when I click the folder, all file under it, will display in the content area.

I have no idea.

sgpoon

Jianjun Hu

Saturday 07 July 2007 8:28:42 pm

By using <b>iframe</b>, the embedded website will open automatically within the iframe.

But I don't know how to make the embedded website open automatically within the area defined in css.

The following is the example.
<b>TestScroll.html</b>

<html>
<head>
<style type="text/css">
div 
{
background-color:#00FFFF;
width:640px;
height:480px;
overflow: scroll
}
</style>
</head>

<body>

<div>
I want the embedded website was displayed here!
</div>
</body>

</html>

Thanks!

OnlyBlue

☆..·°∴°.☆°°.☆°.
°∴ °☆ .·enjoy star° .·★°∴°
∴°.°★ .·°
  ミ☆°∴°.★☆° ∴·°
°.☆° .·∴° 

Is it a pleasure after all to practice in due time what one has learnt?

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.