Understanding the Template Updating option in Dreamweaver 8.0.1-8.0.2
Description
After updating from Dreamweaver 8.0 to either Dreamweaver 8.0.1 or 8.0.2, you will see a new Templates category added to the Site Definition dialog box. This category consists of just one checkbox: "Template Updating: Don't rewrite document relative paths" (shown below):
Why would you want to uncheck the Template Updating checkbox?
By default, the Template Updating checkbox is checked. If your template workflow matches the three-step workflow listed below, you might want to consider unchecking the Template Updating checkbox, otherwise, you should leave it checked. You should consider unchecking the checkbox if your workflow includesall of the following items:
- You are using a Dreamweaver template (DWT file).
- The DWT file contains relative paths pointing to server-side include (SSI) files, CSS files, links or images.
- The SSI files, CSS files, links, or images being pointed to are also located in the Templates folder along with the DWT file. In other words, your Templates folder contains non-template items.
Note: Adobe does not recommend placing any non-template files in the Templates folder. See the Using Dreamweaver LiveDocs for more information. (Ref. 192209)
If you are not using Dreamweaver templates, or you only have DWT files in your Templates folder, you can most likely leave this checkbox checked (the default setting).
What changed in Dreamweaver 8.0?
Dreamweaver MX 2004 and Dreamweaver MX would not touch any path that pointed into the Templates folder, inconsistent from how Dreamweaver would deal with any other types of paths in a template. Due to complaints from some Dreamweaver MX 2004 and Dreamweaver MX users regarding this inconsistency, Dreamweaver 8.0 was changed so that it treated paths into the Templates folder just like it treated any other path. This change caused problems for some Dreamweaver users though, who were used to the Dreamweaver MX 2004 behavior.
In Dreamweaver 8.0, new pages created from templates with paths that pointed into the Templates folder, always had the Templates folder added to the path. For example, in Dreamweaver 8.0, the following code in the parent template DWT file in either a non-editable or editable region:
<!--#include -->
would be rewritten to something similar to one of the following paths when a new child page was created from the template:
<!--#include --> <!--#include -->
The Dreamweaver 8.0 way of writing paths is problematic if you want the item being linked to, to be relative to the child pages and not to the parent template. For example, each of your template child pages may have its own CSS, SSI or image file. In the sample site below, each department has its own unique SSI file that consists of department-specific content, but the SSI files are all named include.inc.
Since the include files' names are the same for all departments, you may have manually entered the path <!--#include --> in the parent template file.
Note: When entering paths in Dreamweaver templates, it is recommended to browse to the file through the Dreamweaver user interface, so Dreamweaver writes the path for you. Manually entering a path in a Dreamweaver template is not a recommended workflow. However, you may find your setup similar to the one above, and there may not be a better alternative for your project.
In the example site above, my_template.dwt has the following path:
<!--#include -->
When you create the child page hr_child_pg.htm from my_template.dwt, the include file path turns into this:
<!--#include -->
Since there isn't an include.inc file in the Templates folder, the page breaks. You can't workaround this problem by placing the include.inc file in the Templates folder, because each include.inc file in the different departments' subfolders actually has different content, even though they all share the same file name. A site root relative path also can't be used because each department's include file has different content -- a site root relative path would just point to one of the include.inc files.
How Dreamweaver MX 2004 and Dreamweaver MX wrote paths
In Dreamweaver MX 2004 (version 7) and Dreamweaver MX (version 6), the following code in the parent template DWT file in either a non-editable or editable region:
<!--#include -->
<!--#include -->
How to get Dreamweaver 8 to leave these paths alone
With the Dreamweaver 8.0.2 or 8.0.1 Updaters, the Template Updating checkbox is checked by default, which means the default behavior is now to leave relative paths alone that point to items located inside the Templates folder, which is the same behavior as Dreamweaver MX 2004 and Dreamweaver MX. If you would prefer to have Dreamweaver 8.0.2 or 8.0.1 treat relative paths that point to items located inside the Templates folder as it would any other path and re-write them, then go into the Site Definition dialog box and uncheck the Template Updating checkbox. That way, Dreamweaver will add the Templates folder to the path, which was the default behavior and only option in Dreamweaver 8.0.
Not recommended: If you cannot, or do not want to, install the Dreamweaver 8.0.2 or 8.0.1 Updaters for some reason, please see the alternate workarounds discussed in Relative paths pointing to items located in the Templates folders are rewritten in new pages created from templates (TechNote 52195a7).
Additional Information
For more information on this issue, see the following blog posts by Stephanie Sullivan on the Community MX website:
This content requires Flash
To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.
Download the free Flash Player now!
