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

Part: V Appendixes > Global Tag Attributes

Global Tag Attributes

The attributes described in Table B.10 can be applied to any of Movable Type's variable tags, and they mostly control how the values they insert are formatted.

Table B.10. Global Tag Attributes
AttributeDescription
decode_htmlSet to 1, this attribute reverses the encoding performed by encode_html. Character entities are converted into the raw characters they represent.
decode_xmlSet to 1, this attribute reverses the encoding performed by encode_xml. Character entities are converted into the raw characters they represent.
dirifySet to 1, this attribute causes the value of the tag to be made safe for use in a file path. Specifically:
  1. The value is converted to lowercase.

  2. Any HTML tags or entities are stripped.

  3. Some high-ASCII characters, such as characters with accent marks, are converted to their unaccented, low-ASCII equivalents. For example, á would become a.

  4. Any remaining characters other than alphanumeric, underscore, and whitespace characters are stripped.

  5. Finally, any whitespace characters are converted to underscores.

encode_htmlSet to 1, this attribute causes the value of the tag to be encoded, suitable for use as HTML. Special characters such as < and > are replaced with the character entities &lt; and &gt; respectively, and so on.
encode_jsSet to 1, this attribute causes the value of the tag to be encoded, suitable for use in a JavaScript string value. Potentially sensitive characters, such as single- and double-quote characters, are escaped with backslashes.
encode_phpThis attribute causes the value of the tag to be encoded, suitable for use in one of three different types of PHP values: single-quote, double-quote, and here document. Acceptable values are

q: Encode for use in a single-quote value.

qq: Encode for use in a double-quote value.

heredoc or here: Encode for use in a here document value.

encode_urlSet to 1, this attribute causes the value of the tag to be encoded, suitable for use in a URL. Special characters, such as spaces, are URL-encoded as their hexadecimal equivalents.
encode_xmlSet to 1, this attribute causes the value of the tag to be encoded, suitable for use as XML—similar to encode_html, but with a larger set of special characters.
filtersThe value of this attribute is a comma-separated list of text formatting filters that will be applied to the text inserted by the tag. The filters will be applied in the order specified.
lower_caseSet to 1, this attribute causes the value of the tag to be converted to all lowercase characters.
remove_htmlSet to 1, this attribute causes any HTML tags to be stripped from the tag's value.
sanitizeSetting this attribute to 1 causes Sanitize to be run on the value of the tag with the default spec. Setting it to 0 explicitly disables Sanitize when it might otherwise be run. This attribute will also accept a custom Sanitize spec as its value, which would be used to sanitize the tag's value.
space_padThis attribute causes the value of the tag to be padded with enough space characters so that its total length is equal to the specified number of characters.
sprintfThis attribute accepts a sprintf formatting string that will be used to format the value of the tag.
trim_toThis attribute causes the value of the tag to be trimmed down to the specified number of characters.
upper_caseSet to 1, this attribute causes the value of the tag to be converted to all uppercase characters.
zero_padThis attribute causes the value of the tag to be padded with enough zeros that its total length is equal to the specified number of characters.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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