Extended Dreamweaver: parsing custom third-party tags

Source: Internet
Author: User
Tags html tags dreamweaver

As Dreamweaver plug-ins have been developed recently, there are very few Chinese materials and their English skills are poor, you can't help but feel dizzy when viewing the English documents. It was imperative to translate some important content into Chinese, so it was quite refreshing. This excerpt is from Extending Dreamweaver 8, which is included in Dreamweaver 8. For the translation, see The Dreamweaver 4 Chinese help translated by chivalrous Island. But to be honest, I doubt that some part of the help is translated by software such as Kingsoft fast translation, which is hard to read than English.

Server technologies, such as ASP, Macromedia ColdFusion, JSP, and PHP, use special non-HTML syntax in HTML files. The server creates and provides HTML content based on these codes. When Dreamweaver detects non-HTML tags, Dreamweaver calls the definition files of third-party tags to compare them. These files specify how Dreamweaver reads and displays these tags.

For example, in addition to the standard HTML language, ASP files also contain ASP code for server parsing. The ASP code looks like an HTML tag. It is marked by a pair of tags starting with <% and disabled %>. In the Configuration/ThirdPartyTags folder of Dreamweaver, there is a folder named Tags. xml file, which describes various third-party tag specifications, including ASP, and defines how Dreamweaver displays the code. Using this method, ASP code has been standardized in Tags. xml, so Dreamweaver will not try to parse any code between <%... %>. However, in the design view, an icon is displayed to indicate that this is ASP code. You can define your own tags and create a new tag library file for each set of tags to specify how Dreamweaver reads and displays your tags.

Note: This section describes how to define Dreamweaver to display a custom tag, but does not describe how to edit the content or attributes of the custom tag. For details about how to create an attribute checker to check and modify the attributes of a custom tag, see the property checker for relevant information.

Each tag library file defines the names, types, content modes, Display specifications, and icons of one or more custom tags. You can create any number of tag library files, but they must be in the Configuration/ThirdPartyTags folder for Dreamweaver to read and process. The tag library file uses the. xml file extension.

Tip: If you are working on several different websites at the same time (assuming you are a freelancer), you can define all the labels in one file, and put it on a special site. When someone else maintains this site in the future, you can hand over the tag library including the custom icon and attribute checker to it.

You need to use an XML tag named tagspec to define a tag specification. For example, the following code indicates a label rule named happy.

<Tagspec tag_name = "happy" tag_type = "nonempty" render_contents = "false" content_model = "marker_model" icon = "happy.gif" icon_width = "18" icon_height = "18"> </ tagspec>

· Script _ model allows the tag to be placed anywhere between HTML tags in the document. When Dreamweaver detects a label that uses this mode, all content of this label is ignored. Using this tag (for example, some ColdFusion labels), Dreamweaver will not parse it.

Start_string specifies a separator as the starting point of the string-defined tag. String-defined labels can be placed in any place where annotations can be inserted. For the code between start_string and end_string, Dreamweaver neither parses nor encodes or links. This attribute is required when end_string has been defined.

End_string specifies a separator as the end point of the tag defined by the string. Similarly, this attribute is required when start_string has been defined.

Detect_in_attribute specifies whether to ignore all the code between start_string and end_string (or between the start and end labels if the two strings are not defined), regardless of whether the property or value is inserted between these codes. The default value is "false". However, the label defined by the string should be set to "true ".

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.