I’ve used dreamweaver template files in the past and recently learned that php include files can also update several pages at the same time. I would be grateful if anyone could break down the benefits of using php includes as opposed to dwt files for updating multiple pages?
Yes. For example. The header section of your site is going to contain the same content for every page (in most cases) logo, nav, search and so on… so instead of having to edit every file your site contains. Paste the content from the header section into a new file, save it as it header.php. Then you would include the header.php into each file. This way you only have to edit header.php to change it site wide.
Is that the only benefit of includes over dwt files? or are there any other benefits? are there any end-user accessibility issues if a developer users include files to build a site?
I assume that includes would be best used for large sites with many pages then.
I’m slightly unsure of all the ramifications of using DW template files, though if you are forced to use DW to maintain the site built using them that would be one downfall.
Great, thanks. The site I used the dwt files for is fairly small and isn’t likely to grow massively. So I will probably stick with the dwt file and try out the php include method next time i develop a site.
All knowledge and answers are appreciated as i’m still fairly new to working with websites.
Big advantage of PHP includes is that you don’t need dreamweaver to edit and recompile stuff. So, if you are out at the beach and have to borrow your g/f’s netbook to make an emergency update of the site, you can tweak the php include without sourcing a copy of dreamweaver, etc.
I use Dreamweaver templates (.dwt files) and Dreamweaver library items (.lbi) to manage a variety of Web sites (.html, .asp, and .php). I also have used both PHP and ASP include statements in sites as well.
Here is an objective breakdown of the two techniques and their processes:
DREAMWEAVER TEMPLATES (PROS)
Can be rendered easily and quickly on a local machine for review purposes (if “Use Temporary File” under preview is set).
Does not require a scripting language (i.e., ASP, ASP.NET, PHP, etc.)
Web pages using templates (and no script includes) render without server-side rendering time.
Depending on usage, maintains consistent coding on all pages of a site (even if script includes are used). For example, one could use a template to make sure that a header, left navigation area, and footer all use script includes, HTML, library items, and so forth in the same manner and code architecture on all pages using the template to maintain consistent coding.
DREAMWEAVER TEMPLATES (CONS)
Requires Adobe Dreamweaver to efficiently update the templates and pages using those templates.
Additional code is inserted in pages, much like a BEGIN and END statement, for each editable content area of a template.
Additional code is inserted at the beginning of a page using a template to specify which template file is being used–this information is used only by Dreamweaver.
All pages using a template must be uploaded after a template change is made.
SCRIPT INCLUDES (PROS)
Only the script needs to be uploaded after a change to it is made.
Does not require any additional applications like Dreamweaver to maintain.
SCRIPT INCLUDES (CONS)
Requires a scripting language (ASP, ASP.NET, PHP, etc.)
Cannot be rendered on a local machine quickly and easily in a WYSIWYG format (e.g., if CSS were used, the include files alone would not appear as they would with the rest of the Web site code wrapped around them).
Requires server rendering time before a page is displayed.
ADVICE
Personally, I use Dreamweaver templates to ensure that my sites are consistently programmed. In some of my sites, I used script includes along with Dreamweaver. If I were to change the path or filename of the include statement, without a Dreamweaver template (or library item), I would have to hand code each page that uses the include statement. At the same time, I use include statements to expedite updating my site by only having to upload one file instead of the whole site.