ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Link from Body to Extended Text in an iFrame?

September 20, 2007 1:00pm

Subscribe [3]
  • #1 / Sep 20, 2007 1:00pm

    yolise

    59 posts

    Maybe this isn’t the best way (or even possible), but upon loading a page, I’d like to display the Body text in an iFrame type box with a link to the Extended Text that would load into the same frame.

    Any ideas how I might do this? I can load a template into the frame, but can’t work out how to make it display the content of the entry (that is, the page it’s on; at the moment, it only loads the latest entry). Not sure if this makes sense. So far it looks like this:

    {exp:weblog:entries weblog="windrush" limit="1"}
    
    <h3>{title}</h3>
    
    <p><iframe src="http://www.blahblah.co.uk/index.php/windrush/iframeContent/"<br />
       height="100" width="600" frameborder="1" scrolling="no"><br />
       Alternative text for browsers that do not understand IFrames.<br />
      </iframe></p>
    
    <p>{/exp:weblog:entries}

    The iframeContent template looks like this:

    {exp:weblog:entries weblog="windrush" limit="1"}
    
    {body}
    
    {/exp:weblog:entries}

    Maybe there’s a completely different way to do this, but I can’t for the life of me think what it could be…

  • #2 / Sep 20, 2007 2:19pm

    e-man

    1816 posts

    I’m not a big fan of iFrames so if you’re going to show the body and extended fields on the same page why not just do so?
    It saves the user one unnecesary click.
    Another way would be to use a Javascript show/hide link, probably a better option then the iframe.
    This thread discusses something similar to what you’re trying to do.

  • #3 / Sep 20, 2007 2:36pm

    yolise

    59 posts

    I’m not a big fan of iFrames so if you’re going to show the body and extended fields on the same page why not just do so?
    It saves the user one unnecesary click.
    Another way would be to use a Javascript show/hide link, probably a better option then the iframe.

    Well, I’m using Expression Engine for a website, not a blog, so the text needs to fit within the layout, even though the copy may be dramatically different lengths. It may be that the text will scroll within a frame - I haven’t quite decided yet.

    Why are you not a fan of iFrames?

    This thread discusses something similar to what you’re trying to do.

    I’m not entirely sure what that does. Have you ever seen an example of what that code does? I’m not really that good with javascript.

  • #4 / Sep 20, 2007 2:42pm

    Lisa Wess

    20502 posts

    How about just setting the height of the div and using the CSS property for overflow? I used to do that on my sites, and it’s entirely CSS therefore SEO friendly, no iFrame needed.

  • #5 / Sep 20, 2007 2:45pm

    e-man

    1816 posts

    Why are you not a fan of iFrames?

    Because they can introduce accessibility problems.
    For an example of show hide see this FAQ page I recently did. It uses the jQuery library which has a few built-in functions for showing and hiding content.

  • #6 / Sep 20, 2007 2:48pm

    yolise

    59 posts

    How about just setting the height of the div and using the CSS property for overflow? I used to do that on my sites, and it’s entirely CSS therefore SEO friendly, no iFrame needed.

    Ah yes. I’d forgotten about the overflow thing. Cheers!

  • #7 / Sep 20, 2007 2:50pm

    yolise

    59 posts

    For an example of show hide see this FAQ page I recently did. It uses the jQuery library which has a few built-in functions for showing and hiding content.

    That looks extremely cool, but sadly far too complicated for the likes of me. Thanks though!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases