Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 9 of 9
  1. #1
    Junior Member Ryan McCullough's Avatar
    Join Date
    Nov 2011
    Location
    Florida, US
    Posts
    2
    Member #
    29939
    Hello!

    Since this is my first post on this forum, I'll introduce myself. My name is Ryan and I'm a 21 year old amateur web designer from Florida, US. I got my first taste of HTML when I was 13, and have since used tutorials and lessons online to learn the basic languages of the web (HTML, CSS, and a little Javascript).

    However, my lack of a formal education in web design leaves some doubts in regards to "proper practice".


    The above represents a portion of a website I'm working on. The trouble I'm having is with the "content" area. Basically, there are going to be a lot of "options" on the right side, and all of the content is going to be fairly similar. It seems like it would be tedious and unnecessary to make an entirely new page for each option, so I was thinking of making the "content" area an iframe, which would load a different page when each option is chosen.

    Is this bad practice? Any suggestions or alternatives would be greatly appreciated!

  2.  

  3. #2
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    In a word..."yes". It's very bad practice. It's search-engine unfriendly and could lead to multiple scrollbars, which is user-unfriendly (more important issue in this case).

    What you want to do instead is look at some form of a server-side include. You can separate your layout from your content and it will merge into one file as far as the user is concerned.

    If you're going to do more advanced stuff, look at using a server-side include from a language such as PHP, ASP.NET or (classic) ASP.

    But at least you had the right thought in mind.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  4. #3
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    There are some simple CSS and js scripts that will do that as well.

    iFrames should only even be considered if the content you're pulling into them is a very small amount, and you really don't care if a search engine ever sees it ( cause most won't even try ), I consider an iFrame as a temp, short term fix for something. Never used as a design component.

    Check Out stunichols.com. For some example of using CSS and a little JavaScript to do what you're looking to do. It just uses CSS to show the different layers of content but all the text is still readable by the search engines.( if that matters at all )

  5. #4
    Junior Member Ryan McCullough's Avatar
    Join Date
    Nov 2011
    Location
    Florida, US
    Posts
    2
    Member #
    29939
    I appreciate your prompt and detailed responses.
    I'll have to keep poking around for a solution. In the mean time (since PHP/ASP isn't something I'm familiar with just yet), I will probably create a separate page for each option.

    Thank you again for your help!

  6. #5
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    You can go the .shtml route. It's basically the same thing as HTML but you get a little bit more to work with in the short run.

    PHP/ASP are just other ways in which you can accomplish the same goal. They're strictly options.

    Check out the link I posted above and you'll probably be good to go.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  7. #6
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    Quote Originally Posted by Ryan McCullough, post: 224657
    Hello!

    Since this is my first post on this forum, I'll introduce myself. My name is Ryan and I'm a 21 year old amateur web designer from Florida, US. I got my first taste of HTML when I was 13, and have since used tutorials and lessons online to learn the basic languages of the web (HTML, CSS, and a little Javascript).

    However, my lack of a formal education in web design leaves some doubts in regards to "proper practice".


    The above represents a portion of a website I'm working on. The trouble I'm having is with the "content" area. Basically, there are going to be a lot of "options" on the right side, and all of the content is going to be fairly similar. It seems like it would be tedious and unnecessary to make an entirely new page for each option, so I was thinking of making the "content" area an iframe, which would load a different page when each option is chosen.
    Is this bad practice? Any suggestions or alternatives would be greatly appreciated!
    When I do HTML sites (as opposed to CMS) I often have a similar layout. I use PHP includes for whatever elements may change across the site, such as menus, etc. I make the one pages and then use it as a template for pages with different content, just changing the content and naming the new page accordingly.
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!

  8. #7
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    Here's a very simple example:
    Index page:
    <body>

    <div id="mainContainer">

    <div id="leftMenu">
    <?php include_once ("menu.php"); ?>
    </div><!-- close leftMenu -->

    <div id="mainContent">

    if(isset($_GET['menuitem']))
    { include_once("interior.php"); }

    else if(($menuitem == "")) {
    include_once("content.php");
    }

    </div><!--close mainContent -->

    <div id="footer">
    <?php include_once("footer.php"); ?>
    </div><!-- close footer -->

    </div><!-- close mainContainer -->

    </body>

    So that would be your index page, and then you'd have a function that would see which menu item was called from the menu, and load the correct interior page. That would look something like this:

    interior.php page:

    $product="";

    if(isset($_GET['menuitem']))
    { $menuitem=$_GET['menuitem']; }

    if(($menuitem == "item1")) {
    include_once("item1.php");
    }
    else if(($menuitem == "item2")) {
    include_once("item2.php");
    }
    else if(($menuitem == "item3")) {
    include_once("item3.php");
    }

    and your menu would look like this:
    menu.php page:

    <ul>
    <li><a href="index.php?item1">Item Number One</a></li>
    <li><a href="index.php?item2">Item Number Two</a></li>
    <li><a href="index.php?item3">Item Number Three</a></li>
    </ul>

    This is just a very basic sample of how it might be - you will have to play around with it to get it to fit what you want.
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!

  9. #8
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    AJAX (XHR) has rendered the IFrame obsolete.

  10. #9
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    Not totally obsolete. It's still useful if you want to present content from an external website while still maintaining the look and feel of your own.

    Mind you, that's a pretty obscure use and one I've only applied once.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search tags for this page

html iframe bad practice

Click on a term to search for related topics.
All times are GMT -6. The time now is 07:41 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com