Recovering a Dreamweaver Template

by James Cook on May 13, 2009

More Dreamweaver Recovery Tips: Recover Dreamweaver Site Definitions | Recover Dreamweaver Passwords

Now that I've gotten Let's Get Started with Dreamweaver out the door, I thought it would be a good time to catch up on a few Tips of the Day (which you may have noticed haven't been happening lately). I have still been answering questions on Twitter as DWcourse so I'll get back in the groove by covering some topics I've addressed there recently.

@michaellunsford asked if there was a way to reconstruct a lost Dreamweaver template from a page created with the template. The answer is yes but it's a bit of work.

BTW, the steps here are based upon a Dreamweaver template recovery article from the University College London Website. I've tested my revised instructions in Mac Dreamweaver CS4 but they should work for earlier versions as well.

  1. Open an "orphan" page created from the missing template.
  2. Select menu File>Save as Template… If you get a warning dialog that the original template can't be found, click OK to dismiss it.
  3. The name of the template used to create a page is displayed in the upper right corner of thedesign View.

    The name of the template used to create a page is displayed in the upper right corner of thedesign View.

    Give the file the same name as the original template (you can find the original template name in a yellow rectangle in the upper right corner of Dreamweaver's Design View).

  4. Click Save and, when prompted, allow Dreamweaver to update links in the file. The file will be saved in the a new or existing Templates folder in the root of your site.
  5. Close the file in Dreamweaver.
  6. Open the file in a text editor such as BBedit, TextEdit or NotePad.
  7. Near the beginning of your file, delete the entire comment:
    <!-- InstanceBegin template="/Templates/yourtemplate.dwt" codeOutsideHTMLIsLocked="false" -->.
  8. Immediately before the closing html tag </html> at the end of your document delete the entire comment:
    <!-- InstanceEnd -->.
  9. Dreamweaver (at least in CS4) inserts a TemplateBeginEditable name="head" area when saving a page as a template. You'll need to delete that. So look for code it the head of the document that looks like this:
    <!-- InstanceBeginEditable name="head" --><meta name="keywords" content="test" />
    <!-- TemplateBeginEditable name="head" -->
    <!-- TemplateEndEditable -->
    <!-- InstanceEndEditable -->

    Delete the extra code:

    <!-- TemplateBeginEditable name="head" -->
    <!-- TemplateEndEditable -->
  10. Now you need to convert all of the InstanceBeginEditable comments into TemplateBeginEditable comments. So search and replace all instances of the following being very careful to match the case of the words exactly:

    Search for: InstanceBegin
    Replace with: TemplateBegin

  11. Now convert the closing comments as well.

    Search for: InstanceEnd
    Replace with: TemplateEnd

  12. Save and close the file.

You should now be able to open and edit the file in Dreamweaver. When you save the file, all your changes should be applied to any document that used the original template.

As always, if you have questions feel free to comment here or tweet me at DWcourse.

HardeepSingh October 2, 2014 at 10:32 pm

Hello Sir,

I don’t have any words to say thank you.

Actually I had accidentally deleted my templates files, I was wondering that from now I have to manually apply changes to each page.

And google gave me your link and I am glad to say that now I have created a new dwt file and its working fantastic.

Once again thank you

Jeanne Meier September 15, 2014 at 7:48 am

Thank you so very much! You saved me SO MUCH WORK! My hard drive crashed while in the midst of changing webhosts, so I lost my local copy and www back up. I was devastated!

Janice July 14, 2014 at 2:48 pm

Thank you so much!!! I damaged my backup drive, the files reside on my computer 1000 miles from here! Yeah, I’m back in business.

Cosmo June 6, 2013 at 10:32 am

Thanks so much for this. Saved me a lot of time… and I knew it was possible, just wasn’t sure of the steps involved so this saved me a lot of trial and error. Cheers

Stephen Jones October 6, 2011 at 6:17 am

LEGEND

Gina August 4, 2011 at 12:29 pm

Wow! This saved the day. Thank you so much.

June Rooney March 27, 2011 at 1:56 am

Thank you SO MUCH for this tip!

amy September 27, 2010 at 10:34 am

Also replace any: InstanceParam
with TemplateParam

Jay Feitlinger July 18, 2010 at 9:47 am

Hi,

I really appreciate the time you took to create the above steps. I am following them but still running into issues. Is there anyway I can email you the file so you can see what I am doing wrong as I am trying to help a friend with editing their website and I am not that experienced with Dreamweaver and don’t want to mess up their site?

Thanks,
Jay

jcook July 19, 2010 at 2:04 pm

@Jay, I’m sorry but I also have a business to run and, while I’m happy to do what I can to answer questions online, I generally charge by the hour for other work.

Comments on this entry are closed.

{ 3 trackbacks }

Previous post:

Next post:

Home | Make Contact