frames alternative for main menu?

Discussion in 'HTML' started by Keith Wiley, Oct 24, 2003.

  1. Keith Wiley

    Keith Wiley Guest

    I want to make a website with a global menu on one side that then brings
    content up in another part of the window. One way to do this is with
    frames. Another way is to have every single page on the site have the
    same menu. However, that means that adding a menu item for a new page on
    the site requires editting all the pages. I am trying to stay clear of
    frames because lots of people harp on them for various reasons.

    I thought there was some style sheet command that generates html code as
    it is interpreted. I figured I could use a style sheet file to generate
    and position the menu items on the page. Every page would read in the
    style sheet, but if I want to modify the menu I only have to change how it
    is constructed on the fly by the style sheet.

    I though the style sheet command was something like "write", but now I
    can't find any reference to it.

    Is this the right way to do this? If so, what is that "write" command,
    and how is it used?

    Thanks.

    ________________________________________________________________________
    Keith Wiley
    http://www.unm.edu/~keithw http://www.mp3.com/KeithWiley

    "Yet mark his perfect self-contentment, and hence learn his lesson,
    that to be self-contented is to be vile and ignorant, and that to
    aspire is better than to be blindly and impotently happy."
    -- Edwin A. Abbott, Flatland
    ________________________________________________________________________
    Keith Wiley, Oct 24, 2003
    #1
    1. Advertising

  2. Keith Wiley

    Adrienne Guest

    Gazing into my crystal ball I observed Keith Wiley <>
    writing in news:p:

    > I want to make a website with a global menu on one side that then
    > brings content up in another part of the window. One way to do this is
    > with frames. Another way is to have every single page on the site have
    > the same menu. However, that means that adding a menu item for a new
    > page on the site requires editting all the pages. I am trying to stay
    > clear of frames because lots of people harp on them for various
    > reasons.


    And they are good reasons, beleive me.

    >
    > I thought there was some style sheet command that generates html code
    > as it is interpreted. I figured I could use a style sheet file to
    > generate and position the menu items on the page. Every page would
    > read in the style sheet, but if I want to modify the menu I only have
    > to change how it is constructed on the fly by the style sheet.
    >
    > I though the style sheet command was something like "write", but now I
    > can't find any reference to it.
    >
    > Is this the right way to do this? If so, what is that "write" command,
    > and how is it used?
    >
    > Thanks.
    >


    You're thinking of javascript, document.write "some text";. But that's
    going to be a problem for visitors without javascript, including search
    engines.

    What you want to do is called Server Side Include, and depends on what your
    host provides, SSI, PHP, ASP, etc.

    *** template.shtml ***
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    <head>
    <title><!-- Your title here --></title>
    <link type="text/css" rel="stylesheet" href="mystyle.css">
    </head>
    <body>
    <div id="menu">
    <!--#include file="menu.inc" -->
    </div>
    <div id="content">
    Your content here
    </div>
    </body>


    *** menu.inc ***
    <ul>
    <li><a href="index.shtml">Home</a></li>
    <li><a href="contact.shtml">Contact</a></li>
    </ul>


    *** mystyle.css ***
    #menu {float:left; width:15%}
    #content {margin-left: 15%}


    Play around with the styling to suit, but this is a basic template. You
    only have to change menu.inc when you want to add/remove items.

    --
    Adrienne Boswell
    Please respond to the group so others can share
    http://www.arbpen.com
    Adrienne, Oct 25, 2003
    #2
    1. Advertising

  3. Keith Wiley

    m Guest

    Keith Wiley wrote:
    > I want to make a website with a global menu on one side that then brings
    > content up in another part of the window. One way to do this is with
    > frames. Another way is to have every single page on the site have the
    > same menu. However, that means that adding a menu item for a new page on
    > the site requires editting all the pages. I am trying to stay clear of
    > frames because lots of people harp on them for various reasons.
    >
    > I thought there was some style sheet command that generates html code as
    > it is interpreted. I figured I could use a style sheet file to generate
    > and position the menu items on the page. Every page would read in the
    > style sheet, but if I want to modify the menu I only have to change how it
    > is constructed on the fly by the style sheet.
    >
    > I though the style sheet command was something like "write", but now I
    > can't find any reference to it.
    >
    > Is this the right way to do this? If so, what is that "write" command,
    > and how is it used?


    If you are on Linux or Unix, you can use
    the cat command of the shell
    as a preprocessor in a one-liner
    to concatinate a number of
    carefully structured text files:

    cat header.txt menu.txt content.txt footer.txt > finished.html

    A lot of more complex preprocessors are available for free download,
    but cat may be all you'll need.

    Almost any programming language can be used to write a preprocessor
    in not very many lines. Perl is particularly easy.

    For online work, investigate server side includes and generated pages
    by Perl or PHP.

    --
    Cheers, m at http://www.mbstevens.com
    ....via Tux and Ice -- 0% GatesBloat
    m, Oct 25, 2003
    #3
  4. Keith Wiley

    Eric Bohlman Guest

    Keith Wiley <> wrote in
    news:p:

    > I want to make a website with a global menu on one side that then
    > brings content up in another part of the window. One way to do this
    > is with frames. Another way is to have every single page on the site
    > have the same menu. However, that means that adding a menu item for a
    > new page on the site requires editting all the pages. I am trying to
    > stay clear of frames because lots of people harp on them for various
    > reasons.
    >
    > I thought there was some style sheet command that generates html code
    > as it is interpreted. I figured I could use a style sheet file to
    > generate and position the menu items on the page. Every page would
    > read in the style sheet, but if I want to modify the menu I only have
    > to change how it is constructed on the fly by the style sheet.
    >
    > I though the style sheet command was something like "write", but now I
    > can't find any reference to it.
    >
    > Is this the right way to do this? If so, what is that "write"
    > command, and how is it used?


    You're thinking of "generated content" but it's inappropriate for this
    purpose because style sheets are always supposed to be optional (its proper
    use is for things like putting the URL next to a link on printed versions
    of a document). Also, browser support for generated content is pretty poor
    at the moment.

    Some sort of inclusion mechanism, whether dynamic (as in the server-side-
    include example another poster gave) or static (achieved by preprocessing)
    is the proper solution to your problem.
    Eric Bohlman, Oct 25, 2003
    #4
  5. Keith Wiley wrote:

    > I want to make a website with a global menu on one side that then brings
    > content up in another part of the window. One way to do this is with
    > frames. Another way is to have every single page on the site have the
    > same menu. However, that means that adding a menu item for a new page on
    > the site requires editting all the pages. I am trying to stay clear of
    > frames because lots of people harp on them for various reasons.


    Shame, it would be better if you avoided them becuase you agree that those
    reasons are worthy.

    > I thought there was some style sheet command that generates html code as
    > it is interpreted. I figured I could use a style sheet file to generate
    > and position the menu items on the page. Every page would read in the
    > style sheet, but if I want to modify the menu I only have to change how it
    > is constructed on the fly by the style sheet.


    No, the only features CSS has to generate content are designed for small
    things (such as displaying the value of an attribute after it, for example:

    a[href^="http:"]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    vertical-align: middle;
    }

    .... which I use in some of my print media style sheets)

    > I though the style sheet command was something like "write", but now I
    > can't find any reference to it.


    There is a write() function/method/whateverJScallsThem in JavaScript, but
    that is probably a worse choice to handle includes then frames.

    Have a read of http://www.allmyfaqs.com/faq.pl?Include_one_file_in_another


    --
    David Dorward http://dorward.me.uk/
    David Dorward, Oct 25, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ian

    alternative to frames

    ian, Jul 14, 2003, in forum: ASP .Net
    Replies:
    5
    Views:
    3,112
  2. SpamProof

    alternative to 'window.parent.frames'

    SpamProof, Jan 16, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    525
  3. Rimu Atkinson

    Frames alternative help

    Rimu Atkinson, Feb 10, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    374
  4. DaveF

    Frames alternative. .net?????

    DaveF, Apr 16, 2004, in forum: ASP .Net
    Replies:
    9
    Views:
    4,746
    Ashish M Bhonkiya
    Apr 16, 2004
  5. Jerry C

    ASP:Menu control Dropdowns show above Main Menu

    Jerry C, Feb 21, 2007, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    205
    Walter Wang [MSFT]
    Feb 26, 2007
Loading...

Share This Page