How to apply Dreamweaver templates on an existing site
Asked Answered
F

2

5

I have an existing site in a path, and I've pointed the DreamWeaver site to it.

Under \templates there is a master.dwt file. But whenever I save this file, none of the html files which should make use of it change. What do I need to do to get DW to update the html files that make use of it? And how does DW know which files should be updated based on the template changing? Does it use an internal store or something because every time I copy the site to another machine, I'll need to link up all the pages to the relevant templates again.

I've tried going into Modify | Templates | Apply, but no templates are listed. I have a .dwt file in the path so why isn't it picking it up??

Fryd answered 14/2, 2012 at 15:58 Comment(0)
E
4

There's several possible issues in play here:

For Dreamweaver to properly recognize the existence of the template, the folder in the root of the site should be Templates and not templates.

Once Dreamweaver "sees" the Template properly you then need to make sure that the proper code is present in the child HTML files so Dreamweaver knows which files to update via the template. This code takes the form of HTML comments scattered throughout the page. You will always have the following line after the <html> tag:

<!-- InstanceBegin template="/Templates/TemplateName.dwt" codeOutsideHTMLIsLocked="false" -->

After that, editable regions are delineated with code that will look like this:

<!-- InstanceBeginEditable name="someregion" -->
stuff you can edit
<!-- InstanceEndEditable -->

Without the above, the child pages will not respond to the template.

Now for the real bad news. Unless the existing pages match up with the template exactly, you are going to have all kinds of problems getting the template to play nicely with the existing content. Doing Modify | Template | Apply Template to the page when the page is already fully formed will generate a dialog box that asks you map the content to the editable regions in the template. But if the rest of the design elements vary from what the template contains, Dreamweaver will preserve those tags alongside what the template will introduce which usually creates a ton of duplicated tags and broken layouts.

You would be FAR better off creating new, blank pages from the Dreamweaver Template and copy/pasting the contents into the editable area and then overwriting the "old" pages with the Save As command.

Elroy answered 7/4, 2012 at 3:45 Comment(0)
W
3

I just encountered this issue myself. I realize this original question was posted some time ago, but for anyone who might encounter this problem in the future, I am posting my solution.

If the only changes made to the template relate to one or more elements contained in an attached/linked file (such as a CSS style sheet or JS file), which changes Dreamweaver allows directly from the .dwt template itself, using the style boxes at the side/bottom, then Dreamweaver does not perceive any change to the actual .dwt file itself. If you want those changes to "take effect" and apply them to all pages, you might type a change to the .dwt file itself, click "save all" - undo the change and click "save all" again. This step is really not entirely necessary, as the changes to dependent files can be affected to the website by putting the dependent file to the website.

Also, Dreamweaver will apply changes to CSS/JS dependent files, across the board, but may continue to use a cache, until closed and reopened.

Wilk answered 6/5, 2016 at 16:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.