Templates: Find all pages using the same template

by James Cook on April 13, 2011

I recently received this question from Darlene Hart:

Is it possible to identify which pages have been generated by a specific Dreamweaver template without actually making a change to the template and choosing to update?  I want to document which files are associated with each of my templates and I would be thrilled to find a simple way of doing that.

There is indeed a simple way to accomplish that task using Dreamweaver's powerful Find and Replace function.

In the code of all template-based pages there is a line near the top that identifies the template used. It looks something like this:

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

In the example above "default.dwt" is the template file name.

So you can use Dreamweaver's Find and Replace function to locate all the files using a given template by searching the source code for the template file name:

  1. Select menu: Edit>Find and Replace…
  2. In the Find and Replace dialog:
    1. Find in: select Entire Current Local Site
    2. Search: select Source Code
    3. Find: enter the file name of one of your templates
    4. Click the Find All button

A list of all pages using the template with the file name you searched for will be displayed in the Search Results panel.

Andrew July 4, 2013 at 12:46 am

Thanks for this. Just what I needed too. Surely there is a menu option for this built into Dreamweaver although I could not find it. I am sure lots of people need to be able to do this at some time.

James Cook July 24, 2013 at 11:18 am

No, there’s no menu option but it would surely be helpful. Although the template function in DW hasn’t been updated in a long time and it looking pretty dated.

Darlene Hart April 13, 2011 at 2:50 pm

Fantastic! You have made my day and I thank you.

Comments on this entry are closed.

Previous post:

Next post:

Home | Make Contact