General Shared Borders question

Discussion in 'HTML & Website Design' started by TheDebacler, Jun 2, 2006.

  1. #1
    Is it possible to make shared borders with regular HTML (Front Page can do it of course). If so, how does one go about this?
     
    TheDebacler, Jun 2, 2006 IP
  2. brian394

    brian394 Well-Known Member

    Messages:
    226
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    108
    #2
    Not being a FrontPage user myself I am unfamilar with this 'Shared Borders' feature you speak of, but after a little research I think I understand it. For the Non-FrontPage users among us here's an explanation from Microsoft...
    So, in effect, they're not really borders at all (as Microsoft puts it they're "page regions"). Basically (if I understand this correctly) they're common page elements that you want to appear on all pages of your site (like you're site's logo or your navigation structure). I don't understand why Microsoft doesn't just call them that ("common page elements"), rather than "shared borders" which makes no sense at all :rolleyes: , but that' s just me.

    Anyway, getting back to what you were asking. So the goal we're trying to achieve here is including "shared borders" or "common page elements" across all pages of your site. If you're using a server-side scripting language (ASP, PHP), then this is easy you can just use include files. You put your common page elements (for instance, you're site's navigation structure) in an include file and simply reference that file on every page of your site. When you need to change it you only need to change it in one place. If you're not using a server-side scripting language (for instance, plain old HTML), then things become a little more complicated. You have a few options in this case. You can...

    1. Put the common page element in an IFRAME. Everytime you need to use that element simply reference the IFRAME. However, I would not suggest this method as it is very bad for SEO (spiders don't read and index the content of IFRAME's).

    2. Put the common page element in a Javascript function. Everytime you need to use that element simply call the function. However, this is also bad for SEO because search engines ignore all Javascript.

    3. The final, and recommended, method if your restrictured to "only html" is to create your own template file. Using your favorite text editor you can create a file that will be used as a starting point for all pages on your site (that will have common attributes). Here's an example of a template I quickly threw together for an HTML 4.01 page (an XHTML page would look slightly different)...

    
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta http-equiv="Content-Style-Type" content="text/css">
    <meta http-equiv="Content-Script-Type" content="text/javascript">
    <meta name="keywords" content="put your site's meta keywords here">
    <meta name="description" content="put your site's description here">
    <meta name="date" content="2006-06-02 09:41:43">
    <meta name="rating" content="general">
    <meta name="robots" content="index,follow">
    <title>Your Title Here</title>
    <link rel="shortcut icon" href="icon.ico" type="image/x-icon">
    <link rel="stylesheet" href="styles.css" type="text/css">
    </head>
    <body>
    <!-- Insert Your Site's Logo Here -->
    <!-- Inside Your Site's Navigation Structure Here -->
    
    
    
    
    
    </body>
    </html>
    
    Code (markup):
    Then, save this file as "template.html". Everytime you need to create a new page on your site just open up this file, add your content, and click File->Save As to save it as a new page, i.e. "contact.html", "about.html", etc.

    There is a problem with this method, though, and it comes when you need to make a change to one of the shared page elements. In this case, you would need to use a Mass Find & Replace Tool to search for and replace all occurrences of the old shared element with the new shared element on ALL of the pages on your site. One such tool that can do this (and that I recommend) is called PowerGREP. But there are literally hundreds of other such tools.
     
    brian394, Jun 2, 2006 IP
  3. Hombre

    Hombre Peon

    Messages:
    27
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi,

    Another method is to use PHP includes: <?php include(filename.ext); ?> for common page elements such as header files, footers and navbars.

    One advantage of this method is that a single file can be altered, styled, updated or whatever and those changes are reflected on every page that contains the 'included' file.

    You can have multiple includes on a page and there is almost no limit on the type of data that you can include using this method..
     
    Hombre, Jun 2, 2006 IP