Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: menu in all pages

  1. #1
    Join Date
    Jan 2010
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default menu in all pages

    alright i have a problem i am trying to add a mean you to all my pages and the menu is in head.html and i want to add it all the pages with haveing to go to every page to edit the menu

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Mind telling us if your host supports PHP?
    Jeremy | jfein.net

  3. #3
    Join Date
    Jan 2010
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    they host everything but ruby

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    You can search through the old discussions here for many options.
    If you can use PHP, though, it should be easy.

    <?php include('directory/menu.htm'); ?>

    That's all.

    Place that code where you want your menu to appear in every page and it will be inserted there.

    Make sure that the main pages end with .php. (.htm will skip the php code.)

    Also, this is embedding the code of menu.htm directly into your page, so plan ahead: don't include <html>...</html> tags, don't have an extra <head> section, remove extra tags, etc. After you set this up, go to one of the pages and choose view>source, and see what the generated code looks like.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. #5
    Join Date
    Jan 2010
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    what if i dont want to rename all the pages

  6. #6
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Then:
    1) Find another way aside from php (but php is the most customizable, useful way).
    or
    2) Set your server to parse all .htm/.html pages as php. This is possible, but inefficient, because every page will be parsed that doesn't have to be. Some people do this, though. Up to you.
    It looks like the code you need in your .htaccess file is this:
    AddType application/x-httpd-php .html

    See more info here:
    http://www.webmasterworld.com/forum92/2298.htm

    But again, be careful when setting your server to parse every .htm page as .php if you don't need to.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  7. #7
    Join Date
    Jan 2010
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    thanks alot

  8. #8
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    The fact that Dragoth has his menu in head.html suggests that he is using a frameset. If so, the solution for having a menu on every page must be different.

    Dragoth, are you using a frameset?
    ===
    Arie Molendijk.

  9. #9
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Yes, PHP is an entirely different approach from frames, and much better (because it ends up being a single page for the viewer).
    If head.html is for a frame, then it will need to be recoded as above.

    And by the way, that link in my post is not necessarily the best information, just the first one that popped up on a google search. It should be easy to find more if you need it.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  10. #10
    Join Date
    Jan 2010
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    no im not using frame set

Bookmarks

Posting Permissions

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