NXSL:GetCustomAttribute
Revision as of 11:34, 22 October 2014 by Tomas Kirnak (talk | contribs)
Get value of node's custom attribute.
Syntax
GetCustomAttribute(node, attributeName)
Parameters
node | Node object, you can use predefined variable $node to refer to current node. You can also use null as node if trusted nodes check is disabled (see Security Issues for more information). |
attributeName | Custom attribute name. |
Return Value
String value of requested custom attribute or NULL if attribute is missing.
Notes
If attribute name conforms to NXSL identifier naming conventions, it can be accessed directly as node object attribute. For example “GetCustomAttribute($node, "my_attribute")” can be changed to “$node->my_attribute”
Examples
GetCustomAttribute($node, "my_attribute") -> "my value" GetCustomAttribute($node, "bad_attribute_name") -> NULL