Click to See Complete Forum and Search --> : How to standardize links
miguelvalenciav
05-05-2007, 11:38 PM
I am creating a site with 32 pages, in each page I use a menu and it uses 32 links,
what happens if i change the name of 1 page or if i add one new page?,
how can i change the link in every single page without doing it manually?.
Can i just standardize the menu for avoid this kind of problems?
this is the page
www.clan88.com
it is in spanish but if you want you can see the source code.
Thanks
felgall
05-06-2007, 02:00 AM
Either server side includes or using an include in any server side language would be the best solution to this as you would only have one file containing the menu and it would be included in all the pages.
You can use jsp, asp, php or any other server side language. For me, it was easy creating templates. I had a footer.jspf, a header.jspf, a nav.jspf, center.jspf and so on.
This is how i accessed those files. However using <jsp:include page> seemed to be slower so I didn't use this in the long run but it works.
<jsp:include page="/includes/footer.jspf" flush="true" />
Using this simple scriptlet worked better in my opinion. This is what I used and it didn't seem to run as slow as the <jsp:include>
<%@ include file="/includes/footer.jspf" %>
In other languages it might be different. in .SHTML you'd use something like
< ! - - #include virtual="/includes/footer.inc" - - >
and so on.
in php it is <?php
include ('path/to/file/from/server/root/file_name.php');
?>
pizzabot
05-11-2007, 02:16 PM
I agree with the others and it is the same method I use. Another alternative is creating a template with Dreamweaver but I don't recommend it. You could make the nav part of the non editable sections but I find templates to be frustrating. The tend to have quirks that can mess up your design. Any way go with includes, with what ever language. Just remember you have to name the files with .php, or .asp or whatever. Includes can be named .inc but those can be downloaded just like an .htm file, so it's better to not use that.
miguelvalenciav
05-13-2007, 04:12 PM
I used SSI as you told me and also y created a js with all the links
Thank you very much