Forum Moderators: open
Rather than have empty 'under construction' sections, I add sections as a site grows. Only problem is that the main button controls often have to be changed. I usually use a collection of rollover gifs in a nested frame. Now with all these pages increasing... if I have to change a button collection, it's a huge job to do it site-wide. I'm just curious how some people handle it. I was thinking about going to an iframe for the button columns, but I couldn't get it to work quite right, and I was worried about potential unforeseen problems. I started numbering button graphics, thinking I could just change the graphic and that would change it site-wide. But it still doesn't change the link.
<html>
<head>
<title></title>
</head>
<body><?php
require($_SERVER['DOCUMENT_ROOT'] . '/somefolder/links.php');
?><p>Some content</p>
</body>
</html>
links.php contains the code for your menu, you only need to change it. One thing to note is the file you use the include on has to have the .php extension. It will work with .html extension but you have to set the server to parse .html as .php .
To further that you can use an include at the top and bottom of the document wrapping the unique content.
<html>
<head>
<title></title>
</head>
<body><?php
require($_SERVER['DOCUMENT_ROOT'] . '/somefolder/dochead.php');
?><p>unique content</p>
<?php
require($_SERVER['DOCUMENT_ROOT'] . '/somefolder/docfooter.php');
?></body>
</html>
[edited by: thecoalman at 1:47 am (utc) on Aug. 13, 2007]
The bad news is that it works fine in a browser from the server, but once the include tag is inserted in a page, it totally destroys how the layout looks in the authoring app. I'm using Dreamweaver MX. Not sure what's happening there.
Now the hard part... Converting the whole site. Ouch.
Thanks,
Dave
Now the hard part... Converting the whole site.
Not that hard - if you have access you can do this yourself, if not, have your admin set it up.
The includes are working because the default action is to parse only .shtml files for includes. Edit your server configuration to also parse .html extensions (or, being Dreamweaver, most likely .htm). On an apache server this is a single line of text in httpd.conf
If you bought Dreamweaver in one of the suites, you will also find Homesite on the disk as part of the package, or maybe even DW does this (I hand code, DW exists on my drive as dead disk space so I don't use it much.) Homesite will rip through a directory of 1000 pages in a search and replace in about 20 seconds. Then you're just down to upload time.
If you think it through, this should take you about an hour. :-)
Just as a simple quick example for the main navigation the include can be a script that determines which page is requesting it and will remove the anchor tag for that link and highlight it with an arrow. Like a "you are here" feature.
It makes no real sense to use an external scripting language for something as simple as file includes if that is the only task at hand. SSI's have their own subset of functions and can do exactly what you describe in that example - in fact, I use SSI's to import output from external scripts where required. Both will work for that.