Docs - Attributes
07/31/2010: SUIT 2.0.1 and Rulebox 1.1.0 released.
What is an Attribute?
An attribute is used to modify the properties of a rule through the template. If a rule is configured to use attributes, any attributes in any order can be used, which will modify variables that the rule's functions use.
Attribute Config
A Double Sided rule using attributes (Such as if) needs two rules to operate. The first matches the unmodified open and close strings (Ex. "[rule]" and "[/rule]"), defines the default variables, and configures how to assign the attributes for it.
The second rule matches the open and close strings for the attribute statement (Ex. "[rule" and "]"), stores its contents, and treats the entire statement as a new opening string.
- Has 'skip' enabled as true.
When both rules combined are successfully matched, a function will define variables on var using the contents of the second rule, have the new var overwrite all of the Static Variables, and continue as normal.
One Sided Attribute Config
One Sided rule using attributes (Such as return) only needs one rule. The Static Variables are the same, except for onesided being true. In addition, the following Config is applied:
- Has 'skip' enabled as true.
When matched, a function will define variables on var using this rules contents, have the new var overwrite all of the Static Variables, and continue as normal.
BBCode Config
Similarly to the Template Ruleset's Attribute Config, each attribute rule requires two rules: one to use the default settings with (Ex. "[rule]" and "[/rule]"), and another one to create modified rules (Ex. "[rule=" and "]"). However, BBCode attributes can only modify one variable: equal. In addition, the attribute string isn't split up by quotes, and additional configuration isn't necessary necessary.





