- Dreamweaver User Guide
- Introduction
- Dreamweaver and Creative Cloud
- Dreamweaver workspaces and views
- Set up sites
- About Dreamweaver sites
- Set up a local version of your site
- Connect to a publishing server
- Set up a testing server
- Import and export Dreamweaver site settings
- Bring existing websites from a remote server to your local site root
- Accessibility features in Dreamweaver
- Advanced settings
- Set site preferences for transferring files
- Specify proxy server settings in Dreamweaver
- Synchronize Dreamweaver settings with Creative Cloud
- Using Git in Dreamweaver
- Manage files
- Create and open files
- Manage files and folders
- Getting and putting files to and from your server
- Check in and check out files
- Synchronize files
- Compare files for differences
- Cloak files and folders in your Dreamweaver site
- Enable Design Notes for Dreamweaver sites
- Preventing potential Gatekeeper exploit
- Layout and design
- CSS
- Understand Cascading Style Sheets
- Laying out pages using CSS Designer
- Using CSS preprocessors in Dreamweaver
- How to set CSS Style preferences in Dreamweaver
- Move CSS rules in Dreamweaver
- Convert inline CSS to a CSS rule in Dreamweaver
- Work with div tags
- Apply gradients to background
- Create and edit CSS3 transition effects in Dreamweaver
- Format code
- Page content and assets
- Set page properties
- Set CSS heading properties and CSS link properties
- Work with text
- Find and replace text, tags, and attributes
- DOM panel
- Edit in Live View
- Encoding documents in Dreamweaver
- Select and view elements in the Document window
- Set text properties in the Property inspector
- Spell check a web page
- Using horizontal rules in Dreamweaver
- Add and modify font combinations in Dreamweaver
- Work with assets
- Insert and update dates in Dreamweaver
- Create and manage favorite assets in Dreamweaver
- Insert and edit images in Dreamweaver
- Add media objects
- Adding videos in Dreamweaver
- Insert HTML5 video
- Insert SWF files
- Add audio effects
- Insert HTML5 audio in Dreamweaver
- Work with library items
- Using Arabic and Hebrew text in Dreamweaver
- Linking and navigation
- jQuery widgets and effects
- Coding websites
- About coding in Dreamweaver
- Coding environment in Dreamweaver
- Set coding preferences
- Customize code coloring
- Write and edit code
- Code hinting and code completion
- Collapse and expand code
- Reuse code with snippets
- Lint code
- Optimize code
- Edit code in Design view
- Work with head content for pages
- Insert server-side includes in Dreamweaver
- Using tag libraries in Dreamweaver
- Importing custom tags into Dreamweaver
- Use JavaScript behaviors (general instructions)
- Apply built-in JavaScript behaviors
- About XML and XSLT
- Perform server-side XSL transformations in Dreamweaver
- Performing client-side XSL transformations in Dreamweaver
- Add character entities for XSLT in Dreamweaver
- Format code
- Cross-product workflows
- Installing and using extensions to Dreamweaver
- In-App updates in Dreamweaver
- Insert Microsoft Office documents in Dreamweaver (Windows only)
- Working with Fireworks and Dreamweaver
- Edit content in Dreamweaver sites using Contribute
- Dreamweaver-Business Catalyst integration
- Create personalized email campaigns
- Templates
- About Dreamweaver templates
- Recognizing templates and template-based documents
- Create a Dreamweaver template
- Create editable regions in templates
- Create repeating regions and tables in Dreamweaver
- Use optional regions in templates
- Define editable tag attributes in Dreamweaver
- How to create nested templates in Dreamweaver
- Edit, update, and delete templates
- Export and import xml content in Dreamweaver
- Apply or remove a template from an existing document
- Edit content in Dreamweaver templates
- Syntax rules for template tags in Dreamweaver
- Set highlighting preferences for template regions
- Benefits of using templates in Dreamweaver
- Mobile and multiscreen
- Dynamic sites, pages and web forms
- Understand web applications
- Set up your computer for application development
- Troubleshoot database connections
- Removing connection scripts in Dreamweaver
- Design dynamic pages
- Dynamic content sources overview
- Define sources of dynamic content
- Add dynamic content to pages
- Changing dynamic content in Dreamweaver
- Display database records
- Provide and troubleshoot live data in Dreamweaver
- Add custom server behaviors in Dreamweaver
- Building forms using Dreamweaver
- Use forms to collect information from users
- Create and enable ColdFusion forms in Dreamweaver
- Create web forms
- Enhanced HTML5 support for form elements
- Develop a form using Dreamweaver
- Building applications visually
- Build master and detail pages in Dreamweaver
- Build search and results pages
- Build a record insert page
- Build an update record page in Dreamweaver
- Building record delete pages in Dreamweaver
- Use ASP commands to modify database in Dreamweaver
- Build a registration page
- Build a login page
- Build a page that only authorized users can access
- Securing folders in Coldfusion using Dreamweaver
- Using ColdFusion components in Dreamweaver
- Test, preview, and publish websites
- Troubleshooting
Use optional regions in templates in Dreamweaver when you want to set conditions for displaying content in a document.
An optional region is a region in a template that users can set to show or to hide in a template-based document. Use an optional region when you want to set conditions for displaying content in a document.
When you insert an optional region, you can either set specific values for a template parameter or define conditional statements (If...else statements) for template regions. Use simple true/false operations, or define more complex conditional statements and expressions. You can later modify the optional region if necessary. Based on the conditions you define, template users can edit the parameters in template-based documents they create and control whether the optional region is displayed.
You can link multiple optional regions to a named parameter. In the template-based document, both regions will show or hide as a unit. For example, you can show a “closeout” image and sales price text area for a sale item.
Insert an optional region
Use an optional region to control content that may or may not be displayed in a template-based document. There are two types of optional regions:
- Non-editable optional regions, which
enable template users to show and hide specially marked regions
without enabling them to edit the content.
The template tab of an optional region is preceded by the word if. Based on the condition set in the template, a template user can define whether the region is viewable in pages they create.
- Editable optional regions, which enable template users
to set whether the region shows or hides, and enable users to edit
content in the region.
For example, if the optional region includes an image or text, the template user can set whether the content is displayed, as well as make edits to the content if desired. An editable region is controlled by a conditional statement.
Insert a non-editable optional region
-
In the Document window, select the element you want to set as an optional region.
-
Do one of the following:
Select Insert > Template > Optional Region.
In the Common category of the Insert panel, select Templates from the drop-down list, then select Optional Region.
-
Enter a name for the optional region, click the Advanced tab if you want to set values for the optional region, and then click OK.
Insert an editable optional region
-
In the Document window, place the insertion point where you want to insert the optional region.Huomautus:
You cannot wrap a selection to create an editable optional region. Insert the region, then insert the content in the region.
-
Do one of the following:
Select Insert > Template > Editable Optional Region.
In the Templates category of the Insert panel, select Editable Optional Region.
-
Enter a name for the optional region, click the Advanced tab if you want to set values for the optional region, and click OK.
Set values for an optional region
You can edit optional region settings after you’ve inserted the region in a template. For example, you can change whether the default setting for the content is to be displayed or not, to link a parameter to an existing optional region, or to modify a template expression.
Create template parameters and define conditional statements (If...else statements) for template regions. You can use simple true/false operations, or define more complex conditional statements and expressions.
In the Advanced tab you can link multiple optional regions to a named parameter. In the template-based document, both regions will show or hide as a unit. For example, you can show a “closeout” image and sales price text area for a sale item.
You can also use the Advanced tab to write a template expression that evaluates a value for the optional region and shows it or hides it based on the value.
-
In the Document window, do one of the following:
In Design view, click the template tab of the optional region you want to modify.
In Design view, place the insertion point in the template region; then in the tag selector at the bottom of the Document window, select the template tag, <mmtemplate:if>.
In Code view, click the comment tag of the template region you want to modify.
-
In the Property inspector (Window > Properties), click Edit.
-
In the Basics tab, enter a name for the parameter in the Name box.
-
Select the Show By Default checkbox to set the selected region to show in the document. Deselect the checkbox to set the default value to false.
Huomautus:To set a different value for the parameter, in Code view locate the parameter in the section of the document and edit the value.
-
(Optional) Click the Advanced tab, then set the following options:
If you want to link optional region parameters, click the Advanced tab, select Use Parameter, then from the pop‑up menu select the existing parameter you want to link the selected content to.
If you want to write a template expression to control the display of an optional region, click the Advanced tab, select Enter Expression, then enter the expression in the box.
Huomautus:Dreamweaver inserts double-quotation marks around the text you enter.
-
Click OK.
When you use the Optional Region template object, Dreamweaver inserts template comments in the code. A template parameter is defined in the head section, as in the following example:<!-- TemplateParam name="departmentImage" type="boolean" value="true" -->
At the location where the optional region is inserted, code similar to the code below appears:
<!-- TemplateParam name="departmentImage" type="boolean" value="true" -->
<!-- TemplateBeginIf cond="departmentImage" --> <p><img src="/images/airfare_on.gif" width="85" height="22"> </p> <!-- TemplateEndIf -->
You can access and edit template parameters in the template-based document.