Start learning with our library of video tutorials taught by experts. Get started

Dreamweaver CS5 Essential Training

Creating a new template


From:

Dreamweaver CS5 Essential Training

with James Williamson

Video: Creating a new template

Creating templates is a two-step process. First, you save the file as a template, and then you create its editable regions. When a file is first saved as a template, everything on the page is initially locked down. Without defining editable regions you wouldn't be able to build any new pages using your template. In this movie, we're going to take the source file that we created in our last movie, save it as a template, and then go in and define all those editable regions that we're going to need for our pages.
Expand all | Collapse all
  1. 2m 57s
    1. Welcome
      1m 8s
    2. Using the exercise files
      1m 49s
  2. 7m 50s
    1. What is Dreamweaver?
      3m 16s
    2. Learning web design
      2m 22s
    3. Current web standards
      2m 12s
  3. 43m 9s
    1. The Welcome screen
      4m 5s
    2. Windows and Mac interface differences
      2m 23s
    3. The Application toolbar
      4m 7s
    4. The Document toolbar
      4m 40s
    5. Arranging panels
      8m 19s
    6. Managing workspaces
      7m 32s
    7. The Properties Inspector
      5m 54s
    8. The Insert panel
      6m 9s
  4. 25m 45s
    1. Basic site structure
      3m 11s
    2. File naming conventions
      1m 49s
    3. Defining a new site
      4m 35s
    4. Managing sites
      4m 51s
    5. Managing files and folders
      6m 36s
    6. Working with browsers
      4m 43s
  5. 27m 21s
    1. Creating new documents
      5m 16s
    2. New document preferences
      3m 6s
    3. Setting accessibility preferences
      4m 56s
    4. Working with starter pages
      3m 46s
    5. Managing starter pages
      10m 17s
  6. 30m 2s
    1. Basic tag structure
      2m 15s
    2. Adding structure to text
      8m 20s
    3. Creating lists
      9m 59s
    4. Getting text into Dreamweaver
      5m 59s
    5. Importing Word documents
      3m 29s
  7. 1h 17m
    1. Understanding style sheets
      2m 16s
    2. The anatomy of a CSS rule
      1m 48s
    3. Setting CSS preferences
      6m 36s
    4. The CSS Styles panel
      10m 2s
    5. Controlling CSS through the Properties Inspector
      5m 14s
    6. Using the Code Navigator
      7m 21s
    7. Using CSS Enable
      6m 45s
    8. Understanding element selectors
      8m 11s
    9. Understanding class selectors
      8m 49s
    10. Understanding ID selectors
      5m 59s
    11. Understanding descendant selectors
      6m 51s
    12. Attaching external style sheets
      7m 44s
  8. 1h 47m
    1. Working with units of measurement
      7m 11s
    2. Declaring font families
      9m 39s
    3. Controlling font sizing
      9m 9s
    4. Controlling weight and style
      8m 0s
    5. Controlling line height
      8m 29s
    6. Controlling vertical spacing with margins
      12m 3s
    7. Controlling spacing with padding
      5m 39s
    8. Aligning text
      8m 26s
    9. Transforming text
      5m 36s
    10. Writing global styles
      15m 42s
    11. Writing targeted styles
      17m 37s
  9. 1h 32m
    1. Understanding image types
      5m 3s
    2. Managing assets in Dreamweaver
      12m 51s
    3. Setting image accessibility preferences
      4m 20s
    4. Setting external image editing preferences
      3m 52s
    5. Placing images on the page
      7m 37s
    6. Photoshop integration
      5m 54s
    7. Modifying Smart Objects
      5m 51s
    8. Alternate Photoshop workflows
      8m 8s
    9. Modifying image properties
      11m 14s
    10. Styling images with CSS
      7m 11s
    11. Using background graphics
      9m 3s
    12. Positioning background graphics
      11m 6s
  10. 55m 16s
    1. Link basics
      3m 37s
    2. Setting site linking preferences
      2m 14s
    3. Creating links in Dreamweaver
      11m 1s
    4. Absolute links
      5m 8s
    5. Using named anchors
      11m 19s
    6. Linking to named anchors in external files
      2m 44s
    7. Creating an email link
      5m 24s
    8. Creating CSS-based rollovers
      13m 49s
  11. 1h 34m
    1. CSS structuring basics
      2m 56s
    2. The Box Model
      13m 21s
    3. Understanding floats
      6m 53s
    4. Clearing and containing floats
      8m 56s
    5. Using relative positioning
      4m 8s
    6. Using absolute positioning
      7m 18s
    7. Creating structure with div tags
      12m 7s
    8. Styling basic structure
      10m 34s
    9. Creating a two-column layout
      10m 37s
    10. Using Live View and CSS Inspect
      7m 51s
    11. Using Browser Lab
      9m 39s
  12. 56m 22s
    1. Reviewing table structure
      7m 41s
    2. Importing tabular data
      5m 13s
    3. Creating accessible tables
      9m 56s
    4. Using thead and tbody tags
      4m 0s
    5. Basic table styling
      8m 45s
    6. Styling table headers
      7m 52s
    7. Styling column groups
      4m 22s
    8. Creating custom table borders
      5m 1s
    9. Styling table captions
      3m 32s
  13. 1h 43m
    1. How forms work
      3m 0s
    2. Reviewing form design
      3m 2s
    3. Creating accessible forms
      7m 33s
    4. Setting form properties
      4m 6s
    5. The fieldset and legend tags
      4m 32s
    6. Inserting text fields
      5m 58s
    7. Inserting list menu items
      5m 26s
    8. Inserting checkboxes
      7m 50s
    9. Inserting radio button groups
      6m 22s
    10. Inserting text areas
      4m 12s
    11. Inserting submit buttons
      3m 37s
    12. Basic form styling
      12m 0s
    13. Form element styling
      8m 52s
    14. Styling form layout
      11m 49s
    15. Adding form interactivity
      2m 47s
    16. Using Spry validation widgets
      12m 49s
  14. 1h 23m
    1. Planning for templates
      10m 51s
    2. Creating a new template
      10m 37s
    3. Using editable attributes
      13m 43s
    4. Creating optional regions
      6m 23s
    5. Creating new pages from a template
      9m 17s
    6. Applying templates to existing pages
      6m 9s
    7. Working with nested templates
      7m 56s
    8. Working with repeating regions
      12m 58s
    9. Modifying templates
      5m 41s
  15. 40m 14s
    1. Behaviors overview
      3m 47s
    2. Hiding and showing elements
      9m 18s
    3. Spry overview
      4m 4s
    4. Using Spry widgets
      11m 36s
    5. Adding Spry effects
      3m 6s
    6. Using the Widget Browser
      8m 23s
  16. 28m 18s
    1. Inserting Flash files
      5m 4s
    2. Setting properties for Flash
      6m 27s
    3. Dreamweaver and Flash integration
      6m 6s
    4. Encoding Flash video
      6m 10s
    5. Adding Flash video
      4m 31s
  17. 45m 28s
    1. Running site-wide reports
      6m 33s
    2. Checking for broken links
      5m 41s
    3. Checking for browser compatibility
      8m 3s
    4. Adding remote servers
      8m 0s
    5. Uploading files
      7m 20s
    6. Managing remote sites
      9m 51s
  18. 34s
    1. Goodbye
      34s

Watch this entire course now—plus get access to every course in the library. Each course includes high-quality videos taught by expert instructors.

Become a member
Please wait...
Dreamweaver CS5 Essential Training
15h 22m Beginner Apr 30, 2010

Viewers: in countries Watching now:

In Dreamweaver CS5 Essential Training, Adobe Certified Instructor James Williamson explores the tools and techniques of Dreamweaver CS5, Adobe's web design and development software. This course covers both the ins and outs of Dreamweaver, as well as recommended best practices for crafting new web sites and files, the fundamentals of HTML and CSS, and how to ensure clean and accessible code. The course also includes how to use tools in Dreamweaver to create and style web pages, manage multiple sites, and add user interactivity with widgets and scripting. Exercise files are included with the course.

Topics include:
  • Defining and structuring a new site
  • Creating new web documents from scratch or from templates
  • Adding and formatting text
  • Understanding style sheet basics
  • Placing and styling images
  • Creating links to internal pages and external web sites
  • Controlling page layout with CSS
  • Building and styling forms
  • Reusing web content with templates
  • Adding interactivity
  • Working with Flash and video
Subject:
Web
Software:
Dreamweaver
Author:
James Williamson

Creating a new template

Creating templates is a two-step process. First, you save the file as a template, and then you create its editable regions. When a file is first saved as a template, everything on the page is initially locked down. Without defining editable regions you wouldn't be able to build any new pages using your template. In this movie, we're going to take the source file that we created in our last movie, save it as a template, and then go in and define all those editable regions that we're going to need for our pages.

So, I'm going to go over to my Files panel and I have defined the 13_02 folder as my root directory. And I'm going to go in and find the main_template.htm. So here is the page that we structured last time. You can see all the placeholders we placed in, Region ID, breadcrumb, Page Heading, and notice that as we click in the links, they all have that baseLink class applied to it. So baseLink has been applied to all those and finally remember in our trivia, we have that trivia body section down there.

So this page is ready to go and we're ready to make a template out of it. So what we're going to do here is go to File and choose Save as Template. Now you don't have to have a page that's fully structured to save as a template. It doesn't really matter. You can take a fully finished page and save it as template, or you can start from scratch. Whichever workflow is going to be faster for the type of site that you're creating. So, I'm going to choose Save as Template. Now, you're going to see something little different here. We don't get to browse to a directory. We just get this dialog box that comes up and says Save as Template.

It asks us which site we want to save it to. In this case, Explore California. It also shows us that currently we don't have any templates in our site. So we can go ahead and save this page as anything we want, but there is a reason that we named it main_template. That is the name that I want for this template, so I'm just going to leave that name as it is. Now, it's always helpful to type in a description for your template, especially if you're going to have multiple templates. So, I'm just going to call this one top level Explore California template.

So, a brief description that describes the type of pages that should be created using that template is a good idea. I'm going to go ahead and hit Save. It's going to ask you if you want to Update Links. Definitely say Yes. Now, let's take a look at why. If you look over your Files panel, we have a folder over there that we didn't have before. This Templates folder was just created and if we look inside of it, we can see the template that we just created, main_template.dwt. Dreamweaver templates use the .dwt extension.

Now, this Templates directory is a very important directory. You don't want to move this around, change it, and delete it, anything like that. Dreamweaver is going to reference the files in this directory for all the pages that you build off the templates. So, it's really important that this remains on the root and that you don't modify it in any way. Now, when you go to upload your pages, you do not need to upload this to your site in order for it to work. Templates really only apply to the local development environment and aren't required by the remote server in order to work properly. Okay, so now that we have our template, the next thing we need to do is go through and add some editable regions.

If we just saved our template right now and closed it and try developing pages off of it, we could build pages, but we wouldn't be able to change anything because everything would automatically be locked down. Creating an editable region is really just as simple as highlighting the regions that you want to be able to change in your template pages and making an editable region out of them. Now, there are a couple of things you have to take into consideration when you're creating a new editable region. Let's create our first one and we'll talk about some of those. Go ahead and highlight the text Region ID.

That's going to change on every single page, so we need to make an editable region out of that. So with that highlighted, I'm going to go up to my menu and go to Insert > Template Objects > Editable Region. Note the keyboard shortcut, Ctrl+Alt+V or Command+Option+V on the Mac. If you're going to be doing a lot of template creation, that's a good keyboard shortcut to know. So, Insert > Template Objects > Editable Region and we're going to be prompted to go ahead and name this. All editable regions have to have a unique name, so we're going to call this one regionID.

I want to make sure that follows your standard naming convention, single word. You can use underscores or Camel Case naming or whatever your personal preference is. I'm going to go ahead and click OK, and there is our first editable region. Now, notice that the editable region is surrounded in sort of this blue outline and kind of has a blue tab. You can change the color- coding on those if you'd like. Locked regions have one color and editable regions have another, but if you're going to change them, you can do that through the preferences. If you're in a team, make sure everybody is using the same color, because you don't want to confuse people if you're using one color for editable regions, and another for locked.

Okay, so the editable region we just created is pretty unique and what we've done is we've created an editable region within a tag. So, our editable region now exists only within this h1 tag. You can see there is a little tag called mmtemplate:editable, and if we'll look at that in Code View or Split Screen View, you can see the Dreamweaver uses these comment tags to identify a template structure. So if you ever look at the code, you can see where editable regions begin and where they end. Well, this editable region is inside the heading.

That means that whoever creates pages based off this template won't be able to modify the heading at all, only the contents of the heading. That's a really big distinction. Do you want to give people the ability to change an entire region, or do you want to give them just the ability to change the text within a specific heading or paragraph? You've got the ability to narrow that focus, or you have the ability to create a really large area like we're about to do next. So, next we want the remainder of our main content area to be an editable region. Now our breadcrumbs will be inside an editable region, but they are also going to be part of something called an optional region, so we're going to be creating them just a little bit later as we tackle those.

Okay, so I want you to place your cursor just below the breadcrumbs and when you do that you'll probably click and select this div tag called mainArticle. Once you have that div tag selected-- an easier way to select it maybe would be to click inside of it and then choose the mainArticle-- you want to switch over to Code View. You want to make sure in Code View that you've lines 48 through 51 highlighted. You want the entire div tag highlighted. The reason that we're doing this is we want the entire div tag to be contained within an editable region. This way you could change that div tab, you could add tags underneath it, and you wouldn't be restricted to only changing the contents of the div tag, so that's very important.

I'm going to switch back to Design View. I'm going to go up to Insert > Template Objects > Editable Region and we're going to name this one mainContent. So now we have an area where our body copy and our page headlines can be entered into and also since we have the entire div tag as part of that editable region, we could add additional div tags afterwards if the page structure demanded that. Okay, let's scroll down and we're going to add our sidebar as an editable region and we're going to do that in a very similar fashion. Just go in and click anywhere inside the sidebar and then select the sidebar itself using the Tag Selector right there.

Now, for this one, we want all of our content within the sidebar to be editable, but we don't want the div tag itself to be inside of an editable region. So, sometimes the best way to do that is to go into Code View. So, I'm going to switch to Code View, and there I can see the beginning of the sidebar and I can see the end of the sidebar. So, what I'm going to do now is I'm going to start selecting at line 55 and I'm going to scroll all the way down to line 70. So make sure that you have the div "specials" highlighted, and the closing div on line 70 highlighted. But the ending div tag for the sidebar, which is on 71, and the beginning div tag for the sidebar, which is on 54, you don't want those highlighted, because we only want our editable region to be inside the sidebar div tag, not surrounding it.

So again, I'm going to go back up to my Design View and I'm going to go up to Insert > Template Objects > Editable Region, and we're going to just call this one sidebar. Now, it may seem like we were having to be extremely precise there and well, we were. When you create editable regions, you really need to think about the structure of the page and what portion of that region needs to be editable. Is it just a headline that needs to be editable? Is it an entire region or is it the contents of the div tag? When you go to make your editable region, you always want to double-check to make sure that you have the proper area highlighted.

Sometimes you might have too large of an area highlighted and sometimes too small of an area highlighted, and the best way to verify that is just to go into Code View, find out precisely which tags you have selected, and what portion of your page is going to be within that editable region. Taking the extra time to do that as you're creating your templates is very important because it's going to save you a tremendous amount of time a little bit later on. So now we have three initial editable regions. We have the regionID, the mainContent, and the sidebar. Go ahead and save your template and Dreamweaver is going to give you a little message. Now, this really isn't an error message. This is more of just letting you know.

Notice that it says "You placed the editable region "regionID" inside a block tag." That's the heading that we're talking about. "Users of this template will not be able to create new blocks in this region." Meaning you won't be able to add paragraphs or new headings up there. "Move this region outside the block tag if you want users to be able to do this." So in this instance we meant to do that, and we want that capability, but it's fantastic that Dreamweaver shows us this message because if that is not what we had intended, or maybe we selected too small of a region, Dreamweaver is going to give us that feedback so that we know, oh, I didn't mean to do that, I need to modify that editable region.

As it is, that's exactly what we wanted to do so we're going to go ahead and click OK. Now, every time we save this template we're going to be faced with that particular message. So, if it becomes annoying to you after a while, you could turn it off. I like leaving it on because it just gives me the confirmation that yes, indeed, I did select that area and that is what I meant to do. Or if I didn't mean to do that, it's always nice to have Dreamweaver reminding me of the fact that editable region might need to be changed. So now I'm going to go ahead and click OK. Now, we're almost done with creating our template, but if we take a moment to think about how we're going to build our pages, there are still two items that we need to be concerned with.

Our navigation needs to change to show that current page and either to hide or show the sub-navigation based on which section of the site we are in. We also need to either hide or display the breadcrumb navigation based upon the page that we're building. So, first we'll create a means of defining what current page we're on and what type of page we're building through the use of editable attributes. Then we'll move on to controlling the visibility of content through the use of optional regions.

Find answers to the most frequently asked questions about Dreamweaver CS5 Essential Training.


Expand all | Collapse all
Please wait...
Q: After creating a website following the instructions in the course, the header background graphic appears correctly in all browsers except Internet Explorer 6 and Internet Explorer 7.  The graphic works properly in IE 8. What can be done to make the graphics appear in IE 6 and IE 7?
A: To make the header background graphic appear, wrap the header div tag in another div tag and give it an ID like “mainHeader.” The problem stems from a bug in Internet Explorer that prevents the browser from dealing with absolutely positioned elements that are right next to relatively positioned elements.  Following the steps above should solve the problem.
Q: In the tutorial, the author links the Tool Tip to the word "More" at the bottom of the thumbnail photo field. I can't figure out how to place the <a> "More" on the thumbnail photo field.
A: In the example, there is a paragraph that wraps an <img> tag and the word "More," which is surrounded by an anchor tag (<a>). The author uses CSS to make sure the parent div tag of the thumbs floats to the left, and is only wide enough for the image. This causes the link text to break down onto another line. Then, the instructor uses CSS to align the link text to the right of the <img>. The link itself is a void JavaScript function, ( javascript();). This gives you a "dummy" link without returning you to the top of the page as the "#" dummy link tends to do.
If you were manually typing the text in, you could select the image, hit the right arrow button, and begin typing. The text should then appear on screen.
Q: In this movie, you are making changes to the HTML in order to customize the text layout on your page (i.e. h1, h2, and h3 tags as well as strong and em tags). I'm wondering why you are not using CSS to do this (i.e. font-size, font-weight). Do you typically use one method, or is it customary to do use both in a layout, and if so, what guidelines would you suggest to determine which to use when?
A: We modify the page's structure through the use of h1, h2, and other heading tags. So when we are choosing heading levels, we're not concerning ourselves with typography; we're establishing page structure. A heading is chosen to denote the level of importance for the heading, not typography.
CSS should always be used for presentation, not HTML.
Q: In the “Understanding ID selectors” movie, the author states that only one ID tag can be used per page, but then he adds two ID tags. Can you please clarify this for me?
A: You can use as many IDs per page as you wish. They just must all use a unique name. Therefore if you assign an element the ID of "header" no other element on THAT page may use the same ID.
Q: I noticed that in this course, the instructor uses this code on his CSS external sheet: @charset "UTF-8"; I was under the impression that this code wasn't necessary. The W3.org site is unclear on the matter. Is it necessary? Is it a best practice? Is it an older form of CSS?
A: The characterset attribute is added automatically by Dreamweaver, and there’s no practical reason to remove it. While it's not needed (the HTML page should indicate which encoding to use for the page) it is helpful if the CSS file is ever imported or used on a page where the characterset isn't specified. Think of it as a safety net for characterset encoding. Not necessary, but not harmful either.
Q: I need to add captions below images that I insert in pages of text. I played all the lessons in Chapter 5 (Adding Text and Structure) but none dealt with captions. I hope the author has an answer or can refer me to a source.
A: In HTML 4 and XHTML 1 (which is what Dreamweaver CS5 uses by default), there wasn't really a way to add captions below your photos. Most web authors would "fake" captions by having paragraphs of text below their images and using CSS to position and style the captions in the desired manner. Many would use a class such as .imgCaption to control the styling. To do this you would essentially position the text underneath the image through CSS (often by grouping the image and the paragraph in a div tag) and italicizing the text.

However in HTML5, there are new elements that allow us to associate images and their captions, the figure and figcaption element. Our author James Williamson just finished a course on HTML5: Syntax, Structure, and Semantics which details how to use it.

HTML5 Doctor also has a nice article on the figure and figcaption elements at http://html5doctor.com/the-figure-figcaption-elements/.
Share a link to this course
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.
Upgrade now


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.

Upgrade now

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 CS5 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 preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Welcome to the redesigned course page.

We’ve moved some things around, and now you can



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.

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