How do I create an updatable menu?

Discussion in 'HTML & Website Design' started by irideflatland, Apr 19, 2006.

  1. #1
    I'm thinking about making another website, but I want to be able to add menu selections after I start working on that section. Like with my current website, there are only 3 menu things, and that's all I'm going to have. But on my next site I want to start off with 1, and then when I work on the next subject I want to be able to add another thing to the menu, and so on.

    How do I do this without editing each webpage?
     
    irideflatland, Apr 19, 2006 IP
  2. cashboy

    cashboy Peon

    Messages:
    66
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Well, you could use iframes of frames to achieve that... or maybe javascript or any server-side scripting lang...such as php
     
    cashboy, Apr 20, 2006 IP
  3. stuw

    stuw Peon

    Messages:
    702
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #3
    frames is probably the easiest way to do that, but if you have php on your server then there is a very easy way to do what you want.

    1. change all your pages from .html to .php

    2. make a file called /includes/menu.php

    3. put the html you want for your menu in /includes/menu.php

    4. put in your webpages where you want the menu to appear <?php include ($_SERVER['DOCUMENT_ROOT'].'/includes/menu.php'); ?>
     
    stuw, Apr 20, 2006 IP
  4. irunbackwards

    irunbackwards Peon

    Messages:
    791
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #4
    irunbackwards, Apr 20, 2006 IP
  5. Farkas

    Farkas Well-Known Member

    Messages:
    389
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    140
    #5
    Farkas, Apr 20, 2006 IP
  6. irideflatland

    irideflatland Banned

    Messages:
    515
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I tried the SSI, and it looks like my server (I use Godaddy) doesn't enable it.

    I don't want to use frames, because I'm probably going to be buying a template, and the template will probably include tables and tableless, and I will probably use tableless. That's what I'm doing with my current site.


    So would I still be able to edit the pages with Frontpage? I like using the code/preview thing.
     
    irideflatland, Apr 20, 2006 IP
  7. Farkas

    Farkas Well-Known Member

    Messages:
    389
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    140
    #7
    Yes indeed, php include should also work :) .
    Btw just use dreamweaver or something, Frontpage isn't that good imo exept the latest version.
     
    Farkas, Apr 20, 2006 IP
  8. irideflatland

    irideflatland Banned

    Messages:
    515
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I have 2003, that's the latest right?
     
    irideflatland, Apr 20, 2006 IP
  9. Farkas

    Farkas Well-Known Member

    Messages:
    389
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    140
    #9
    yes that's the latest version :)
     
    Farkas, Apr 20, 2006 IP
  10. cashboy

    cashboy Peon

    Messages:
    66
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Does GoDaddy also offer hosting services? I thought it is only for domain names....
     
    cashboy, Apr 20, 2006 IP
  11. stuw

    stuw Peon

    Messages:
    702
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Not sure about frontpage, but if you use dreamweaver and you make your include paths relative to your pages rather than root
    eg
    instead of include($_SERVER['DOCUMENT_ROOT'].'/includes/menu.php');
    use include('../includes/menu.php');

    Then dreamwever will include the relevent code in the design / preview mode. What's more if you click on the included file in design view it will open it up in a new window to edit
     
    stuw, Apr 20, 2006 IP
  12. irideflatland

    irideflatland Banned

    Messages:
    515
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Yes, it's like $4 a month I think.
     
    irideflatland, Apr 20, 2006 IP