Updating your template to MX format.
There may come a time when you realize that your Dreamweaver 4/UltraDev 4 (DW4) templates do not migrate smoothly forwards into Dreamweaver MX (DMX). You most likely discover this because of persistent DMX error messages regarding changes to locked regions, or other 'seemingly unrelated' prompts when you attempt to edit your child pages. At this point, it might be worth asking: 'What do I need to do to make my template 100% DMX friendly?'
The answer is quite short and the solution is easy to implement as long as you do each step in turn and only save the changes to the page when advised by this tutorial.
CAUTION: Do a site backup prior to performing this function.
A BUG: Something to keep in mind if you are working with nested templates - the template engine will always put an asterisk beside a nested template's name (i.e., mark the file as 'dirty') because the template engine always updates the nested template too when editing it and saving changes. The workaround is to not save the nested template until you close it, then the issue is null and void.
Note: {space} represents a press of the spacebar.
The Steps:
- Open the base template
- Perform the following find/replace:
Find:
<!-- #BeginEditable{space}
Replace:
<!-- TemplateBeginEditable name=
Note: DO NOT SAVE YET! - Perform the following find/replace:
Find:
<!-- #EndEditable -->
Replace:
<!-- TemplateEndEditable -->
Note: OK to save here if you like, but don't update the site just yet! - Insert an optional region (name it anything you'll remember).
- Save the changes and update the child pages and nested templates.
- Delete the optional region AND the parameter that has been added to the head region (in step 4), save the changes, and update the site (this forces the template engine to update existing child pages and nested templates to the new DMX format).
- The Inconsistent Region Names dialog will appear. Select the optional region that you named in step 4, in the Move Content to New Region, select Nowhere and click the Use for All button. Then click the OK button.
(Thanks to Joe D'Andrea for bringing this to our attention)
- Insert the DMX head editable region by performing the following find/replace:
Find:
</head>
Replace:
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
</head> - Save the changes and update the site.
- Close the template.
- Upload changed files to the server.
At this point, your template is converted and its child pages should reflect the new template syntax.
NOTE: If you already have created nested templates in DMX from the original DW4 template, then you need to open each nested template and perform the following steps.
- Open the nested template
- Perform the following find/replace:
Find:
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
Replace:
<!-- InstanceBeginEditable name="head" -->
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
<!-- InstanceEndEditable -->
Note: You are, in fact, inserting a duplicate named editable region named 'head' but in this instance it is perfectly OK (since one is an INSTANCE, and one is a TEMPLATE region)! - Close the nested template, and when prompted to save changes, select YES. You will also be prompted to update associated child pages - choose YES.
- Repeat for each nested template.
- Upload all changed files to the server.
Now, each and every template, nested template, and child page is updated to the new MX syntax, and you should encounter no further errors when adding Parameters, Optional Regions, and MultipleIf conditional regions, or when editing the page in DMX.
Complete details can be found by reading our 'Expert Tutorial' in the following book:
Macromedia Studio MX Bible
By: Joyce J. Evans
Publisher: John Wiley & Sons
ISBN: 0764525239
Available: February 3, 2003.