Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Creating a new template

From: Dreamweaver CS3 Essential Training

Video: Creating a new template

Now that you're a little more familiar with the way a template looks and acts, it's time to take a look at how to create our own. In this movie, we're going to take a regular HTML page, and convert it into a template, and then begin adding editable regions to it. Editable regions allow you to make some part of your pages editable, while locking down everything that is not in that editable region. We saw this in action in the previous movie. By default, everything in the template is locked. So unless you specify that something is editable by placing it in an editable region, {italic}Dreamweaver{plain} will lock it down, and no one will be able to touch it, or change it, in pages that are attached to that template. We'll talk about that in a moment. First of all, let's open up a file called ourproducts-base.html This is just a page that we have designed to act as the basis for other pages.

Creating a new template

Now that you're a little more familiar with the way a template looks and acts, it's time to take a look at how to create our own. In this movie, we're going to take a regular HTML page, and convert it into a template, and then begin adding editable regions to it. Editable regions allow you to make some part of your pages editable, while locking down everything that is not in that editable region. We saw this in action in the previous movie. By default, everything in the template is locked. So unless you specify that something is editable by placing it in an editable region, {italic}Dreamweaver{plain} will lock it down, and no one will be able to touch it, or change it, in pages that are attached to that template. We'll talk about that in a moment. First of all, let's open up a file called ourproducts-base.html This is just a page that we have designed to act as the basis for other pages.

And that's basically the way works. When you're creating a new template, it's best to just design the bare skeleton of the page, containing all the elements that you want to appear on all the pages that are going to be based off this template. You just leave out any specific content, which you'll then add, once you create the pages based off your template. Let's just assume we spent some time, and we've built this entire page to look exactly the way it is right now. And we're ready to save it as a template. To do so, we just come up to File menu, and choose the Save as Template. First, it asks you which site you want to save it in. You can save this in any one of your sites that you've defined in {italic} Dreamweaver.{plain} But obviously it makes sense to save this in the actual site you're going to use it in. We're currently in teacloud 16. So that's correct. We can see any existing templates in this site here. If we want to, we can add a plain description of this template, so we can remind ourselves what this template is used for.

I might just call this "Layout for our products pages." And then you can choose a Save as name for the template. I'm just going to call this ourproducts. Just to be consistent with other the template, AboutTea, we'll put in some capitalization here. I'll click Save. It's going to ask me if I want to update links. That really provides a lot of information to you, doesn't it? When you save a document as a template, {italic}Dreamweaver{plain} copies that document into the templates folder that I showed you here in the Files panel. When the document is copied to the templates directory, all links, including any image tags, as well, not just hyperlinks, must be updated so that the template can find all the assets necessary to display the page correctly. So you always want to click yes to update links when saving the document as a template. And I'll click yes. And it's been saved. Notice it's been converted to a template now. You can see the template in double brackets up here. And its extension is dwt for {italic}Dreamweaver{plain} template.

So now that we have created our template, we need to decide which areas we want to be editable, and which areas we want to keep locked. By default, there are no editable regions in the new template. If I were to save this template as is, and create a new page from this template, you wouldn't be able to make any changes, except for the page title up here. Let's take a look at how we create these editable regions. The first area I want to be editable is this SubSection header. We're always going to start our pages off with the header "Our Products:" but then the name of the actual page is going to be different on each one of these pages. So with that text selected, I'm going to go to the Insert menu, choose Template Objects, and choose Editable Region. And it's going to ask us to give this region a name. We'll just call this Sub Section Heading. And click OK. So you can see that the name that we just typed appears above that section. Now if I click out of that, you can see that area is highlighted, and that indicates that this area of the template is editable by you, or any other members of your team, who might be working on this page.

Now, just so you know, if you don't see these tabs, this color tab at the top, make sure you come up here to Visual Aids, and make sure Invisible Elements is selected. If that's not selected, you won't see that. So make sure that's turned on. Similarly, if you don't like the colors that {italic}Dreamweaver{plain} uses to separate out these different sections, you can go to {italic} Dreamweaver > {plain}Preferences, or if you're on Windows, Edit > Preferences. And if you go to the Highlighting category list, you can set the colors here for editable regions. Okay, so let's add another editable region. That going to be our content region down here, where we want to be able to add more text to any pages based off this template. So again, I'll choose Insert > Template > Editable Region. And we'll just call this Content. And there is our editable region, and as a general rule, it's good to give your editable regions plain English names, so that others working with the templates understand what should go in these areas. You should avoid using special characters, but spaces are fine. Alright, so now that we have designated these editable areas, we can go ahead and close the template, making sure we save our changes.

And we've now created a new custom template. If we look over into the Assets panel, into templates, you can see there's the OurProducts template we just created. Now if I wanted to create a page based on this template, all I have to do is right-click on the template, or Ctrl + click if you're on a Mac with one mouse, and just choose New from Template, meaning we're going to create a new page from the template I just right-clicked on. So here it is. Notice that it says Template OurProducts, and my mouse cursor is this No symbol, meaning I can't select, or click on any of these items out here, and I can only work inside the editable regions. Now the first thing I should do is save this. So let's choose File > Save. And let's save this in the ourproducts folder. And let's just call this ordering.html.

And we'll save that. So we can come in here, and select this text, and change it. Make it "How to Order," and then we can come in here, and start entering our text, or tables, or images. Basically, anything we want to add in here is fine. I need to keep in mind that this is the only area where the content can go, or change, unless I go back and edit the template. We do have some placeholder text, if you want to put some content in here. I'm not going to make you type a whole bunch of stuff in here. If I open up placeholder.txt, I've just got some Greek text here, we'll just select that and copy it. I'll just paste that in here, just so we can see how this works. There it is. We already have a style sheet applied to this page, which is why the text is now styled. As you can see, you can work with these editable regions, just like you can with any other page that isn't attached to a template. The only difference here is you can only work within the editable regions. On the chance that you have a page that you've created from a template, but you decide that you don't want it to be attached to a template anymore, you want free control over the entire page, what need to do is go to the Modify menu, to Templates, and from here you can choose to Detach from Template. And again, see once I do that, this whole page is now editable. I can select the images, the logo, basically anything. I've completely removed it from the template. So that's useful for situations where you want a page to start off looking like one of the templates you've created, but you don't necessarily want it to be controlled by the template. So you can base a new page off that template, make your changes, and then unlock that page from that template. I'm just going to Undo that. Keep that attached. And we'll save this page, and close it.

And in the next movie, we'll take a look at how to apply templates to existing documents.

Show transcript

This video is part of

Image for Dreamweaver CS3 Essential Training
Dreamweaver CS3 Essential Training

129 video lessons · 87022 viewers

Garrick Chow
Author

 
Expand all | Collapse all
  1. 1m 12s
    1. Welcome
      1m 12s
  2. 21m 0s
    1. HTML vs. XHTML
      3m 4s
    2. What is CSS?
      3m 48s
    3. What is XML?
      2m 11s
    4. What is DHTML?
      1m 9s
    5. What is JavaScript?
      1m 23s
    6. File naming conventions
      3m 22s
    7. What is an index page?
      6m 3s
  3. 46m 18s
    1. Setting up your workspace
      2m 39s
    2. The Welcome screen
      4m 11s
    3. Windows and Mac differences
      3m 18s
    4. The Insert bar
      4m 38s
    5. The Property Inspector
      1m 50s
    6. The Document toolbar
      6m 6s
    7. The Document window
      9m 11s
    8. Panels and panel groups
      6m 58s
    9. Saving workspace layouts
      2m 22s
    10. Defining a default browser
      5m 5s
  4. 24m 59s
    1. Defining a site
      9m 5s
    2. File and folder management
      3m 11s
    3. Understanding path structure
      3m 17s
    4. Adding content to a site
      6m 6s
    5. Creating a site map
      3m 20s
  5. 38m 39s
    1. Creating a new blank site
      6m 0s
    2. Creating and saving a new document
      7m 54s
    3. About DOCTYPE
      3m 59s
    4. Inserting images
      9m 26s
    5. Inserting text
      3m 35s
    6. Aligning text and images
      4m 9s
    7. Inserting meta tags
      3m 36s
  6. 45m 58s
    1. Link basics
      6m 4s
    2. Linking with Point to File
      5m 18s
    3. External links
      4m 15s
    4. Creating email links
      5m 49s
    5. Named anchors
      7m 37s
    6. Linking to a file
      7m 35s
    7. Image maps
      9m 20s
  7. 1h 8m
    1. About CSS
      4m 52s
    2. Anatomy of a style sheet
      4m 10s
    3. CSS and page properties
      10m 11s
    4. Moving an internal style sheet to an external style sheet
      6m 46s
    5. The CSS Styles panel
      3m 48s
    6. CSS selectors
      2m 37s
    7. Type selectors
      12m 13s
    8. ID selectors
      10m 21s
    9. Class selectors
      5m 42s
    10. Creating rollovers with pseudo-class selectors
      7m 22s
  8. 42m 54s
    1. CSS vs. the Font tag
      2m 42s
    2. Formatting text with the Property Inspector
      8m 41s
    3. What measurement should I use?
      3m 15s
    4. Managing white space with margins, padding, and line height
      8m 34s
    5. Using font lists
      5m 45s
    6. Aligning text
      2m 47s
    7. Creating lists
      5m 8s
    8. Creating Flash text
      6m 2s
  9. 43m 19s
    1. About tables
      1m 28s
    2. Tables in Code view
      2m 36s
    3. Creating and adding content to tables
      7m 40s
    4. Changing table borders with XHTML
      5m 46s
    5. Coloring tables with XHTML and CSS
      6m 41s
    6. Aligning table content
      6m 39s
    7. Sorting tables
      3m 6s
    8. Setting table widths
      4m 48s
    9. Creating rounded-corner tables
      4m 35s
  10. 28m 22s
    1. Dreamweaver's layout tools
      3m 8s
    2. Tracing images
      4m 58s
    3. Adding AP div tags
      7m 29s
    4. Working with Layout Tables
      6m 55s
    5. Adjusting table widths and nesting tables
      5m 52s
  11. 16m 19s
    1. What is a device?
      3m 14s
    2. Attaching a printer-friendly style sheet
      3m 5s
    3. Styling for print
      7m 41s
    4. Adobe Device Central
      2m 19s
  12. 29m 54s
    1. Rollover rules
      3m 31s
    2. Creating simple rollovers
      5m 36s
    3. Creating disjointed rollovers
      7m 12s
    4. Creating navigation bars with multiple states
      9m 21s
    5. Creating Flash buttons
      4m 14s
  13. 26m 32s
    1. Viewing the code
      6m 9s
    2. Editing in Code view
      3m 0s
    3. The Code toolbar
      5m 11s
    4. Working with Code Collapse
      4m 27s
    5. The Quick Tag Editor
      2m 20s
    6. Working with snippets
      5m 25s
  14. 32m 45s
    1. About forms
      3m 23s
    2. Adding text fields
      9m 52s
    3. Adding checkboxes and radio buttons
      5m 37s
    4. Adding lists and menus
      6m 5s
    5. Submitting form results
      3m 23s
    6. Styling form elements with CSS
      4m 25s
  15. 23m 17s
    1. Opening a new browser window
      9m 38s
    2. Creating a popup message
      2m 50s
    3. Validating text fields
      2m 42s
    4. Getting more behaviors
      7m 2s
    5. Removing extensions
      1m 5s
  16. 14m 58s
    1. External image editor preferences
      3m 18s
    2. Built-in image editing tools
      3m 11s
    3. Roundtrip editing from Dreamweaver to Fireworks or Photoshop
      4m 39s
    4. Copying and pasting
      3m 50s
  17. 34m 16s
    1. Templates in action
      5m 12s
    2. Creating a new template
      6m 36s
    3. Applying templates
      3m 36s
    4. Modifying a template
      1m 40s
    5. Adding repeating regions
      3m 28s
    6. Working with repeating regions
      3m 13s
    7. Adding optional regions
      3m 34s
    8. Creating a library item
      3m 48s
    9. Modifying a library item
      3m 9s
  18. 13m 2s
    1. Using the History panel
      4m 24s
    2. Saving History steps as commands
      3m 25s
    3. Using Find and Replace
      5m 13s
  19. 14m 44s
    1. W3C accessibility guidelines
      4m 6s
    2. Accessibility preferences
      1m 29s
    3. Inserting accessible images
      3m 2s
    4. Inserting accessible tables
      2m 53s
    5. Inserting accessible form objects
      3m 14s
  20. 26m 17s
    1. About media objects
      2m 6s
    2. Linking to audio and video files
      5m 56s
    3. Embedding audio and video files
      7m 7s
    4. Setting parameters
      4m 27s
    5. Inserting Flash content
      2m 37s
    6. Inserting Flash video
      4m 4s
  21. 28m 47s
    1. Getting site reports
      3m 35s
    2. Checking links sitewide
      3m 30s
    3. Signing up with Tripod
      6m 36s
    4. Entering remote info
      4m 13s
    5. Publishing your site
      5m 41s
    6. Updating and publishing pages
      5m 12s
  22. 44s
    1. Goodbye
      44s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ .

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Dreamweaver CS3 Essential Training.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member ?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferences from the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.