How to apply Dreamweaver templates on an existing site

I have an existing site in transit, and I pointed the DreamWeaver site to it.

In \ templates is the master.dwt file. But whenever I save this file, not one of the html files that should use it changes. What do I need to do to get DW to update the html files that use it? And how does DW know which files should be updated based on a template change? Does he use an internal store or something like that, because every time I copy the site to another computer, I will need to again link all the pages with the corresponding templates.

I tried to enter Modify | Patterns | Apply, but no templates. I have a .dwt file in the way, so why don't you select it?

+4
source share
2 answers

There are several possible problems here:

For Dreamweaver to correctly recognize the existence of a template, the folder in the root of the site must be Templates , not Templates .

Once Dreamweaver “correctly” sees the “Template”, you need to make sure that the correct code is present in the child HTML files, so Dreamweaver knows which files to update through the template. This code takes the form of HTML comments scattered throughout the page. After the <html> , you will always have the following line:

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

After that, editable areas are indicated by code that will look like this:

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

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

Now for the real bad news. If the existing pages do not match the template exactly, you will have all sorts of problems so that the template plays well with the existing content. Running Modify | Template | Apply Template Modify | Template | Apply Template Modify | Template | Apply Template on the page, when the page is already fully formed, will create a dialog box in which you will be asked to specify the content in editable areas in the template. But if the rest of the design elements are different from what the template contains, Dreamweaver will keep those tags next to the one that introduces the template, which usually creates a ton of duplicate tags and broken layouts.

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

+3
source

I myself ran into this problem. I understand that this original question was published some time ago, but for those who may encounter this problem in the future, I submit my solution.

If only the changes made to the template relate to one or more elements contained in the attached / linked file (for example, in the CSS style sheet or JS file) that changes Dreamweaver, allows .dwt directly from the template itself, using style windows from the side / bottom, then Dreamweaver does not accept any changes to the actual .dwt file itself. If you want these changes to take effect and apply them to all pages, you can enter the change in the .dwt file, click "save all" - discard the change and click "save all" again. This step is really not absolutely necessary, since changes to the dependent files may be affected on the website by placing the dependent file on the website.

In addition, Dreamweaver will apply changes to CSS / JS dependent files in all directions, but may continue to use the cache until it is closed and reopened.

+3
source

Source: https://habr.com/ru/post/1396428/


All Articles