New Template Updating Feature in DW 8.01

With little fanfare (blow your trumpets please!) Macromedia Adobe introduced a new feature in the Dreamweaver 8 updater regarding template paths (see the full technote for more information).

What this means for us lowly developers, is that if we're using includes or folder specfic images and such inside Dreamweaver, we can have each file in a directory include another file inside the child page's directory... As I read that again it doesn't make a lick of sense, so here's an example:

Let's assume that every folder in your site relates to a specific section. And let's assume that you want to have a section image unique to each section. When you're looking at the rum section in the /rum folder, you want /rum/section.gif to display. When you're perusing the whiskey section at /whiskey/index.cfm, you want /whiskey/section.gif to display. A simple request right? Well it wasn't an easy task to accomplish before the latest updater.

Now, if you link to any file inside the Templates directory from a .dwt file, then when child pages are updated, any links to pages inside the Templates folder will not be rewritten. So let's assume the following directory structure:

wwwroot
|--Rum
|  |--index.cfm
|  |--section.gif
|--Templates
|  |--SiteLayout.dwt.cfm
|  |--section.gif
|--Whiskey
   |--index.cfm
   |--section.gif

Inside SiteLayout.dwt.cfm you have an <img> tag like so:

<img src="section.gif" />

Now, when you create a child page from the SiteLayout.dwt.cfm file, that image link won't be <img src="../Templates/section.gif"> as it would have been in Dreamweaver 8.0. Instead, it will be <img src="section.gif />, which means that each page based on the template will link to the section.gif file in its own folder.

Now that's just good stuff I tell you... If you don't like that feature however, you can turn it off by editing your Site Definition, clicking on the Templates category, and unchecking the "Don't rewrite document relative paths" checkbox. This will revert Dreamweaver 8.01 to Dreamweaver 8's default behavior.

Have fun!

Posted by Daniel Short on Feb 12, 2006 at 12:00 AM | Categories: (X)HTML - CSS - Dreamweaver -

4 Comments

rita

rita wrote on 02/12/06 4:50 PM

Hi Dan, Have been hunting for some help on a template issue and thought your "template updating feature" might shed some light, but I don't think it's quite what I want. I have a site that I use 2 templates for. One of them is for posting articles. I want to change the meta tag key/description words on each page to relate to the specific article that is posted to give it more chances for the search engines to pick it up. My problem is that it doesn't look like I can make the meta tag keywords or descriptions an Editable Region. DW tells me I "can't insert a region there" I don't want to make each page not a template as there will be many article pages and I don't want to have to manually change each page when there is a universal change to them. Have you ever tried this? Is there a way to make it work? I am using DW 8. Anyways, thought this was a problem you might find worthy enough to post on your site...with a solution.... Thanks, Rita
Daniel Short

Daniel Short wrote on 02/12/06 4:50 PM

Hi Rita, All you have to do is put your meta tags and keywoard between these tags in the <head> of any page based on a template: <!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable --> If you don't have that inside the <head> of your template, just add it in there and you should be fine.
Mike

Mike wrote on 02/13/06 1:32 PM

Good information Dan. By the way, the Dreamweaver Update link above does not work because of a capital letter in Dreamweaver. Try the following: http://www.macromedia.com/support/dreamweaver/ One more thing. You have a good suggestions for someplace to host a ColdFusion based site? Thanks. Mike
Daniel Short

Daniel Short wrote on 02/13/06 1:32 PM

Thanks for the tip on the link, I'll get that fixed. As for CF hosting, I do some myself, but CrystalTech is also a biggie in the CF world.