1 person found this helpful
Use server side includes. It's the fastest and easiest way to update menu's on sites with 10 or more pages.
1 person found this helpful
usually, you do it in this way:
<li><a href="../Link01.php">Link for area 01</a></li>
<li><a href="../Link02.php">Link for area 02</a></li>
<li><a href="../Link03.php">Link for area 03</a></li>
<li><a href="../Link04.php">Link for area 04</a></li>
BUT, if you want really put about 30 links here, you should consider to come up with a well-considered logical sequence. The best way is to build some expressive subdirectories.
This will succeed in a easy way by using a spry menu. Here I'll post a random selection of useful links:
While Breqent is right that server side includes are the best way of doing this if you aren't up on
server side coding then you can use Dreamweaver to manage you menu.
You do this by simply ensuring you never edit the menu area on any individual page.
It should therefore be identical on all page and as such you can just use find and replace across the entire site or folder to edit all occurances of your menu.
I hope this helps.
You can use DW Templates (DWTs) to build the page layout, common headers, footers and navigation menus that will appear on all site pages. Then add Editable Regions for content that changes from page to page.
In addition, you can use Server-Side Includes (SSIs) for things that may change during the life of your site such as menus, ads or images. SSIs are a convenient way to manage your site because you only need to edit 1 file and upload to server. Changes are populated to pages on the server-side.
Guidance on when to use DW Templates, Library Items and SSIs -
Personally I'd go with a php include.
I've used those loads on my site for menu's, side bar infor and headers/footers. They are dead easy to set up and manage and will do exactely what you need.
simply design your menu is a seperate php file (with absolutelu nothing but the menu in it)
then in the position you want the menu to appear in your script put <?php include 'menu.php'; ?>
it can't get any easier!
very good suggestion. The optimum would be now to link our two proposals: Use Spry-menu + includes.
It seems there are a ton of ways to skin a cat. Thanks a lot everyone!
Now, which is the easiest for a dyed in the wool newbie like me?
Seems like the PHP route might be best since I haven't even heard of the other methods and they seem like they're more involved...? Of course, nothing's involved if you're familair with it, so I'll try to study up on the other mentioned methods. However, having a PHP menu that each page on my site refers to allows me to easily create new pages in the future and have them point to that same PHP menu - which I can easily update any time - seems like it would save me the most time in doing what I want to do.
Now, if anyone has any (detailed) information about how to do a PHP include for a menu in Dreamweaver....?
PHP = a Server-Side Include.
Your parent pages must use a document extension that is:
a) supported by your web server and
b) tells the server to parse includes on the page.
The most common ones are .shtm, .shtml, .php, .asp or .cf.
If unsure which file extension to to use, ask your host. If your host doesn't support server-side includes, change hosts.
How to Use Server-Side Includes with DW
I'm a totaly noob at this stuff too, I've used php to build my site and don't understand spry stuff (i've seen it on the DW menus...but always skipped past it! I probably should spend the time to learn one day!)
the way I created my first include, and it was a menu too, was to simply build it as normal in a full page. Once you have it looking the way you want, simply copy and past the code for the menu into a new file. Now if your using div's you'll either need to include the div tags in every file (which is what I did as I use the same template on every page) or include the div tags in the code you copy.
Paste the copied code into a new file and save it as something like menu.php.
Save menu.php in you main file tree somewhere (I created a seperate Includes folder and put them all in there)
then on each page go to the current menu location, remove the code you have there (but keeping div tags in place) and add the include line I mentioned before. you will need to make sure the pages using the include are saved as .php and NOT .html or they won't work.
And thats it, 'Simples'
PS if you put the Includes in a seperate folder you'll need to change <?php include 'menu.php'; ?> to <?php include 'foldername/menu.php'; ?>
Ok so I just made the entire menu, saved it as menu.php, and had my website pages point to it. In order to see live view, however, it wants to connect to a server, upload files and do a bunch of stuff and I have no idea what's going on.
So I scratched that, named the menu "menu.html" , added all the code, and now in live view everything looks like it's supposed to.
Now I'm wondering if when I actually upload the files and try to view it, I am going to have problems.
I saw on some youtube video that you have to add something to your .htaccess file to make includes named as *.html viewable, so I did that. Hopefully everything will be ok...?
I've never used an html file as an include but I guess it should work!
Can't offer much to help though sorry!
every single page in my site is a .php, I figured that way I can still use it as plain html (it will present in the same way) but if I add any scripts or includes I don't have to rename the file and therefore update the links.
I'm sure plenty of purists will say that I shouldn't....but it works for me :-)
>I saw on some youtube video that you have to
>add something to your .htaccess file to make
>includes named as *.html viewable
The name of the include file does not matter. What does matter is the name of the parent file. It needs an extension that will cause the server to parse the page looking for includes. For static pages, shtm(l) are common, but you can modify your server to parse any page. Depending on your host, you can likely contol this from the host control panel. Any type of dynamic page will already by parsed by the server.
When building dynamic pages or pages that will parse includes, it's a very good idea to install a local testing server. This way you can test pages locally on your PC before uploading them to your web server.
Popular PHP & MySql testing servers:
MAMP for Mac
Also see, setting-up a Local Test Server in DW CS4