• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Project 4. Controlling Navigation Elemen... > Controlling Document Meta Data

Controlling Document Meta Data

You will modify the base Dreamweaver template in this section of the project. Before you add display content, you must configure the template’s base structure by

  • Converting the editor comment to accept a modified date

  • Converting the Meta Author tag to be customizable

  • Adding editable meta keywords and description tags

You will be performing these conversions and additions by employing template parameters and expressions mostly through the use of the Make Attribute Editable dialog. Follow these steps:

Make sure that the Project 04 site is selected, and use the Files panel (F8) to open the template named project04.dwt in the Templates folder.

Select the Split button (Show Code and Design views) so that you can see both the code and layout of the template concurrently. Select View > Head Content (Ctrl+Shift+H/Cmd+Shift+H) so that you can see the head block content visually.

Position your cursor in line 17 (Meta Author tag) in Code view and select Modify > Templates > Make Attribute Editable. In the Editable Tag Attributes dialog that opens, set the following, then click OK:

Attribute: CONTENT

Make Attribute Editable: Checked

Label: Meta_Author

Type: Text

Default Value: Enter Your Name Here!

Position your cursor at the end of line 27 and type the following (or use snippet MX Magic 2004 > Project 04 > 01-Comment_Mod_Date Param):

Listing 4.1.

<!-- TemplateParam name="Comment_Mod_Date"type="text" value="Month DD, YYYY" -->



Once a child page is created, you can use the Contribute menu selection Format > Template Properties to modify these parameter values to the desired content. This is the only way to modify the value of <meta> tags within Contribute to be unique on each page.

You can repeat the process of step 3, using different values with the other <meta> tags that you wish to make editable within Contribute.

Keywords and Description can be handled without the use of parameters by adding these <meta> tags to the Editable Region named head. This won’t meet your needs, however, because the site is already developed, and changes to Editable Regions of the Template file will not propagate to existing child pages. What you need to do is insert the <meta> tags in the locked region (to avoid this propagation issue) and set them up to use template parameters similar to step 3.

Scroll up to the Editor’s Comments block (line 6) and replace the date value—July 20, 2003—with @@(Comment_Mod_Date)@@ (or use the snippet 02-Comment_Mod_Date Expr). On line 7, replace the text Brad Halstead with @@(Meta_Author)@@ (or use the snippet 03-Meta_Author Expr).

In Code view, position your cursor at the beginning of line 18. Insert two <meta> tags using Insert > HTML > Head Tags twice. Choose Description and then Keywords. For the value of each, type Add Content Here!.

Position your cursor in the meta description tag and select Modify > Templates > Make Attribute Editable. In the Editable Tag Attributes dialog, set the following, and then click OK.

Attribute: CONTENT

Make Attribute Editable: Checked

Label: Meta_Description

Type: Text

Default Value: Add Content Here!


Configuring the description and keywords this way enables the user to do everything from one interface instead of having them make various menu selections. It also saves you from having to perform a search and replace to put the meta tags in the Editable Region on all existing pages so that their values can be manipulated.

Repeat step 7 for the meta keywords on line 19, using a label of Meta_Keywords.

Select Modify > Templates > Check Template Syntax and click OK in response to the message. This verifies that the template markup written to the page is syntactically correct. If you see an error message here, then please review the previous steps for any mistakes you may have made.

Save the modified template (Ctrl+S/Cmd+S). When the Update Template Files dialog opens, click the Update button. The Update Page dialog will show you which child pages were updated.

Click the Close button to close the dialog.

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint