Dreamweaver - CS3

Lesson 48: Templates (3)

48/58 Lessons 

Template to existing page

To apply a template to a page that has already been provided with a lay-out, we have a different way to proceed.

For example, I have my index page which has already been made, but not linked to a template. If I proceed the same way, I get my logo, menus and title two times, but that does not work.

If we need such page (s), we need to proceed in another way.

Because I do not like to type everything 2 times, let alone the content of this page, I copy and paste.
Select the content you want to keep, or rather to copy.
Click Ctrl + C on your keyboard to copy.

Select the body tag in the Tag selector and click the Delete button on your keyboard.
This removes everything in your page.

Click Ctrl + V on your keyboard.
This pastes the content that we had just copied back into the blank page.

Now we only have the content of this page, so it is easy to provide a template.
Just click the “Modify” button in the menu bar.
Select “Templates” and click “Apply Template to page”.
Select the template in the dialog that appears and click the “Select” button.
If the check box for the text “Update page when template changes” is not checked, check this. For this is the ultimate idea of a template.

In the “Inconsistent Region Names”, we need to lend a hand to Dreamweaver.

Dreamweaver can not know what goes where exactly.

So, first select the line “Document Body”, click the downward pointing arrow and choose the editable region in the list where you want to put this, in this case the “content” field.

In other words, everything in the body tag of our document is posted in the editable region, “content”.

The second line “Document Head” is a bit ambiguous.

This in fact has nothing to do with headers like h1 or h2, but with the HEAD tag in the source code. And this, you would only choose when there is already a Java script or something similar in the HEAD tag of your document which should definitely be “transferred”.

I have nothing important in the HEAD tag of this page, so I choose this “Nowhere” in the list and click the OK button.

Our index.html is now based on the template “basis”.
You can see this at the top right of our page.

Awesome!
You've completed Lesson 48
START NEXT LESSON