Working with browser profiles

 < Day Day Up > 

Browser profiles are the files Dreamweaver uses to check your documents when you run a target browser check (see Using Dreamweaver). Each profile contains information about the HTML tags and attributes that a particular browser supports. A browser profile can also contain warnings, error messages, and suggestions for tag substitutions.

Browser profiles are stored in the Configuration/BrowserProfiles folder in the Dreamweaver application folder. You can edit existing profiles or create new ones using Dreamweaver or a text editor. It is not necessary to quit Dreamweaver before editing or creating browser profiles.

About browser-profile formatting

Browser profiles follow a specific format. To avoid parsing errors during target browser checks, follow these rules when editing or creating profiles:

  • The first line is reserved for the name of the profile. It must be followed by a single carriage return. The name on this line appears in the Target Browser Check dialog box and in the target check report. It must be unique.

  • The second line is reserved for the designator PROFILE_TYPE=BROWSER_PROFILE. Dreamweaver uses this line to determine which documents are browser profiles. Do not change or move this line.

  • Two hyphens (--) at the beginning of a line indicate a comment (that is, the line is ignored during the target check process). A comment must start at the beginning of a line; you can't put two hyphens in the middle of a line.

  • You must use a space in the following places:

    • Before the closing angle bracket (>) on the !ELEMENT line

    • After the opening parentheses in a list of values for an attribute

    • Before a closing parentheses in a list of values

    • Before and after each pipe (|) in a list of values.

  • You must include an exclamation point (!) without a space before each of the following words:

    ELEMENT, ATTLIST, Error, and msg (ELEMENT, !ATTLIST, !Error, !msg ).

  • You can include !Error, !Warning, and !Info within the !ELEMENT or the !ATTLIST area.

  • !msg messages can contain only plain text.

  • HTML comments (!---->) cannot be listed as tags in browser profiles because they interfere with parsing. Dreamweaver does not report an error for comments because all browsers support them.

The following example shows the syntax for a tag entry:

 <!ELEMENT htmlTag NAME="tagName "> <!ATTLIST htmlTag unsupportedAttribute1 !Error !msg="The unsupportedAttribute1 attribute of the htmlTag tag is not supported.Try using supportedAttribute1 for a similar effect." supportedAttribute1 supportedAttribute2 (validValue1 |validValue2 |validValue3 ) unsupportedAttribute2 !Error !msg="Don't ever use the unsupportedAttribute2 attribute of the htmlTag tag!" > 

The elements shown in this syntax are defined as follows:

  • htmlTag is the tag as it appears in an HTML document.

  • tagName is an explanatory name for the tag; for example, the name for the hr tag is "Horizontal Rule." The NAME attribute is optional. If specified, tagName is used in error messages; if you do not supply a name, htmlTag is used in error messages.

  • unsupportedAttribute is an attribute that is not supported. Any tags or attributes not specifically mentioned as supported attributes are assumed to be unsupported. Specify unsupported tags or attributes only when you want to create a custom error message.

  • supportedAttribute is an attribute that is supported by htmlTag. Only tags listed without an !Error designation are considered to be supported by the browser.

  • validValue indicates a value that is supported by the attribute.

The following example shows an entry for the APPLET tag that would be accurate for Netscape Navigator 3.0:

 <!ELEMENT APPLET Name="Java Applet"> <!ATTLIST APPLET Align (top |middle |bottom |left |right |absmiddle | absbottom |baseline |texttop ) Alt Archive Class !Warning !msg="This browser ignores the CLASS attribute for the APPLET tag." Code Codebase Height HSpace ID !Warning !msg="This browser ignores the ID attribute for the APPLET tag. Use NAME instead." Name Style !Warning !msg="This browser ignores the STYLE attribute for the APPLET tag." VSpace Width > 

Creating and editing a browser profile

You can create a browser profile by modifying an existing profile. For example, to create a profile for a future version of Microsoft Internet Explorer, you can open the profile for the most recent version of Internet Explorer that has a profile, add any new tags or attributes introduced in the new version, and save it as a profile for the new version.

NOTE

Before you create a browser profile for a new version of a browser, check the Macromedia Exchange for Dreamweaver site at www.macromedia.com/exchange/dreamweaver to see if Macromedia has supplied a browser profile that you can download and install using the Extension Manager.


To create or edit a browser profile:

1.

Open an existing profile for editing.

If you're creating a new profile, open the profile that most closely resembles the profile you want to create, and save the file under a new filename.

2.

If you're creating a new profile, change the name that appears on the first line of text in the file. (Two profiles cannot have the same name.)

3.

Add any new tags or attributes that you know are supported by the browser, using the syntax shown in "About browser-profile formatting" on page 30.

If you don't want to receive error messages about a particular unsupported tag, add it to the list of supported tags. If you do this, save the profile in a separate file with a new filename (such as Browsername x.x limited). Giving this alternate profile a new name preserves the original profile with only the tags that are truly supported.

4.

Delete any tags or attributes that are not supported by the browser.

This step is probably unnecessary if you are creating a profile for a new version of Netscape Navigator or Internet Explorer because browsers rarely drop support for tags.

5.

Add any custom error messages according to the syntax shown in "About browser-profile formatting" on page 30.

The profiles that come with Dreamweaver list all supported tags for the specified browsers. To add a custom error message to a tag, type !msg = "message" after !Error. The following example shows information that appears in the Netscape Navigator 3.0 profile (along with other attributes not shown here):

 <!ELEMENT HR name="Horizontal Rule"> <!ATTLIST HR COLOR !Error > 

To add a custom error message enter !msg= followed by your error message in quotation marks ("):

 <!ELEMENT HR name="Horizontal Rule"> <!ATTLIST HR COLOR !Error !msg="Internet Explorer 3.0 supports the COLOR tag in horizontal rules,but Netscape Navigator 3.0 does not." > 

6.

You can use !Error for all error situations, or you can use !Warning or !Info to indicate that a tag will be ignored but will not actually cause an error.

     < Day Day Up > 


    Developing Extensions for Macromedia Dreamweaver 8
    Developing Extensions for Macromedia Dreamweaver 8
    ISBN: 0321395409
    EAN: 2147483647
    Year: 2005
    Pages: 282

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