description

Description of the current view.


Description of the view changes depending on the type of view. For an item page, it is a short snippet from the item. For a feed page, it is the blog's description text.


description is a member of the view dictionary.



description has data type string

Strings are quote-wrapped sequences of characters.

Metadata

Metadata are implicit properties belonging to a data type. If your data has the name 'foo', you reference it with 'data:foo'. If the metadata is 'bar', you can reference the value of foo's metadata bar with 'data:foo.bar'.

length: Provides the number of characters in the string.
size: Same as length.
escaped: Provides the HTML escaped equivalent of the string. This is useful when the string may represent user input, to avoid HTML injection attacks
jsEscaped: Provides the JS escaped equivalent of the string. This is useful when the string may represent user input, to avoid JS errors.
jsonEscaped: Provides the JSON escaped equivalent of the string. This is useful when the string may represent user input, to avoid JSON errors.
cssEscaped: Provides the CSS escaped equivalent of the string.

Operators

string1 == string2
(Also supported with the syntax eq)
Returns true if the first string is equal to the second (case-sensitive).
string1 contains string2
(Also supported with the syntax in)
Returns true if the first string contains the second (case-sensitive).
snippet(string, options)
Produces a short snippet from an HTML string.
options: Object specifying the snippeting options, which are:
  • links: boolean for whether to preserve anchors/links in the snippet. Defaults to true.
  • linebreaks: boolean for whether to preserve linebreaks (
    tags
    ) in the snippet. Defaults to true.
  • ellipsis: boolean for whether to append an ellipsis (…) to the end of the snippet. Defaults to true.
  • length: Number specifying the maximum length of the snippet.
Example usage
<b:eval expr='snippet(data:post.body, { length: 150, links: false, linebreaks: false })' />




View all "view fields