Forum Moderators: mack
If I want a menu on all of my pages that is the same, but I dont want to update all the pages to just add one more link to the menu, what technique(s) can be used? i.e., I just want some site navigation related links at the bottom of every page, or in the left sidebar...but as I add to it, I want it to update all pages (or those predefined with it). This seems like a "dynamic template" type of thing and is obviously everywhere but I just dont know how its done (im sure there are several techniques)?
1. Include the same menu-file in each page using server-side scripting or an SSI statement (needs to be supported on the server).
2. Generate one page which contains all static info (the header, the menu, ...) and which has content that changes depending on the variables in the page's URL (e.g. www.domain.com?widget=value).
Now, there may be a third message, but I'm not too comfy with CSS yet to be sure this would work: use the :before and :after CSS pseudo elements.
Create your menu and call it "navigation.shtml"
then write this on your main pages that need the menu. Note the .shtml, this tells the server that you are going to use a SSI page.
ie.
<!--#include file="navigation.shtml" -->
I use DW MX for my website. I used the templates feature to manage the site. They are ok, sort of...If I change a link in the nav menu on the template and click save, DW asks me if I want to update all the pages built off the template, I click yes, and in about 5 seconds it updates about 90 pages. Fast, yes. But...the change won't show on my website until I "synconize" (upload) the changed pages; all 91 pages (90 pages, plus the template). It uses an ftp connection to my server and I can only get dial-up service where I live, so that 91 page upload takes about 30 minutes. Now if I change all 9 of my templates (one for each main area) and all my pages (about 350) it takes about 2 hours (change the template, update the pages, then upload the newer versions. Which by the way, I have to upload in blocks of about 30-40 as anything more that that, makes me time out and lose my connection.
So yes the DW templates are nice to some extent. But my new website I'm in the process of building I am trying to find a way to use some sort of SSI (which I'm having trouble with right now) for my header nav menu, sub menus, footer, and ad spaces.
Later,
Rob