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

Thread: centrally stored menu

  1. #1
    Join Date
    Nov 2009
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default centrally stored menu

    Hi there,

    I'm looking for a way to centrally store and maintain a website navigation menu. The idea is that I can edit the menu without having to edit all the pages of my website. I use a vertical (css) dropdown menu.

    Is this possible? And how do I do this?

    Gr. Henk
    Last edited by henkroos; 11-11-2009 at 08:16 AM.

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

    Default

    Does your host support PHP? To find out if they do, make a new file called "test.php" on your website. Inside that file, put the following code:
    PHP Code:
    <?php
    phpinfo
    ();
    ?>
    Then link me to the page.

    Good luck.
    Jeremy | jfein.net

  3. #3
    Join Date
    Nov 2009
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi Nile,

    My host does support php. You can see that on www.qstitch.nl/test.php
    Hope you can help me?

    Gr. Henk

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

    Default

    Ok, make a file called .htaccess, and put this code in it:
    Code:
    AddType application/x-httpd-php .html
    Then, make a file called menu.php. Place your menu links in that file(example
    Code:
    <a href="Home.html">Home</a>
    Then, on ever page, replace your navigation bar with:
    Code:
    <?php
    require('menu.php');
    ?>

    That should work, tell me if it doesn't. (You'll be able to change menu.php to what ever you want your menu to be, and it SHOULD effect all teh pages.)
    Jeremy | jfein.net

  5. #5
    Join Date
    Nov 2009
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi Nile,

    Thank's for the help. I'm going to try it and let you know how it went.
    The first file I have to name .htacces? Do I need to put anything before the dot?

    Gr. Henk

  6. #6
    Join Date
    Nov 2009
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    Default

    Hmmm, in your .htaccess remove the current code, and add:
    Code:
    RemoveHandler .html .htm
    AddType application/x-httpd-php .php .htm .html
    if that doesn't work, try:
    Code:
    AddType php5-cgi htm html
    Good luck!
    Jeremy | jfein.net

  8. #8
    Join Date
    Nov 2009
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Nile,

    I've tried them both but no succes. Maybe it is because of the way the menu is built?
    Partially css and partially script. A piece of the script is in the external stylesheet and
    the rest is in the html document.

    Or is it because the menu html is in an <UL>?

    http://www.qstitch.nl/tijdelijk/qstitch.css


    Gr. Henk

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

    Default

    No, it is not the way the menu is built.

    Ok, I know for sure this will work:
    Change all the files from .html to .php.

    Haha, good luck!
    Jeremy | jfein.net

  10. #10
    Join Date
    Nov 2009
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Nile,

    It works like a charm. Thank's a million.
    Do you have any preference on wich code I put in the .htaccess file?
    Or is there no difference what so ever? I've tried them all and they all
    seem to be working fine now?

    Gr. Henk
    Last edited by henkroos; 11-10-2009 at 07:30 PM.

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
  •