Chapter 9. Using Template Parameters


What You Will Learn

In this lesson, you will:

  • Learn more about template parameters

  • Make an attribute editable

  • Delve into template expressions

  • Control table row classes with template expressions

  • Code sequential navigation links

  • Display navigation status automatically

Approximate Time

This lesson takes approximately one hour and 45 minutes to complete.

Lesson Files

Media File:

LessonFiles/Lesson_09/css/bg_lessons.css

Starting Files:

LessonFiles/Lesson_09/css/bg_ct.css

LessonFiles/Lesson_09/Templates/dean_letter_v2.dwt

LessonFiles/Lesson_09/Templates/life_lessons.dwt

LessonFiles/Lesson_09/Templates/press_release.dwt

Completed Files:

FinalFiles/Lesson_09/css/bg_ct.css

FinalFiles/Lesson_09/Templates/dean_letter_v2.dwt

FinalFiles/Lesson_09/Templates/life_lessons.dwt

FinalFiles/Lesson_09/Templates/press_release.dwt

If you completed the Lesson 8 exercises that covered optional regions, you already saw template parameters in action. When a Macromedia Contribute or Dreamweaver user accesses the Template Properties dialog box and changes the display state of an optional region from false to true (or vice versa), the value changed is a template parameter. But enabling or disabling an optional region is just the tip of the iceberg when it comes to what you can do with template parameters. One of the most useful applications for template parametersdemonstrated in this chapteris to make an attribute editable within an otherwise locked tag and allow it to be changed within Contribute.

Template parameters are set at design-time in either Dreamweaver or Contribute. Any given template parameter in one child page can be set to a different value in another child page, even if both child pages are derived from the same template. In fact, this facility provides template parameters with much of their inherent power. Take into account what you already know about dependent optional regions, factor in template parameters, and you have an extremely flexible templating system. For example, you could alter one template parameter and completely change all the key elements on a page, including logo, page title, and navigation.

Template expressions bring automation power to your template designs, as in this class-switching repeating region.

Although template parameters are a robust instrument in the Dreamweaver/Contribute templating system, template expressions are the real power tools. Template expressions are calculations, just like mathematical expressions such as 3 + 7. However, instead of the resulting value always being a number, a template expression can result in a text string such as a URL (tutorial03.htm, for example) or a template parameter value, a hexadecimal color value such as #00FF00, or a regular number.

In this lesson, you'll apply template parameters and template expressions to expand the Contribute user's power, while maintaining control as the Dreamweaver designer. In addition to setting up editable attributes, you'll create a template parameter system that automatically develops navigation links for use in a multipage tutorial.



Design and Deploy Websites with Macromedia Dreamweaver MX 2004 and Contribute 3(c) Training from the Source
Design and Deploy Websites with Macromedia Dreamweaver MX 2004 and Contribute 3: Training from the Source
ISBN: 032128884X
EAN: 2147483647
Year: 2006
Pages: 130
Authors: Joseph Lowery

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net