|
#1
|
|||
|
|||
|
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
|
||||
|
||||
|
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:
Good luck.
__________________
|
|
#3
|
|||
|
|||
|
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
|
||||
|
||||
|
Ok, make a file called .htaccess, and put this code in it:
Code:
AddType application/x-httpd-php .html ![]() Code:
<a href="Home.html">Home</a> 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.)
__________________
|
|
#5
|
|||
|
|||
|
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
|
|||
|
|||
|
Hi Nile,
I tried it but it does not seem to work. What did I do wrong? http://www.qstitch.nl/tijdelijk/menu.php http://www.qstitch.nl/tijdelijk/.htaccess http://www.qstitch.nl/tijdelijk/home.html http://www.qstitch.nl/tijdelijk/borduren_algemeen.html http://www.qstitch.nl/tijdelijk/bestellen.html Gr. Henk |
|
#7
|
||||
|
||||
|
Hmmm, in your .htaccess remove the current code, and add:
Code:
RemoveHandler .html .htm AddType application/x-httpd-php .php .htm .html Code:
AddType php5-cgi htm html
__________________
|
|
#8
|
|||
|
|||
|
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
|
||||
|
||||
|
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!
__________________
|
|
#10
|
|||
|
|||
|
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 |
| Thread Tools | Search this Thread |
|
|