Difference between revisions of "NXSL:GetCustomAttribute"

no edit summary
(Created page with "__NOTOC__ Get value of node's custom attribute. Function returns requested attribute's value on success or NULL if given attribute does not exist. == Syntax == GetCustomAttri...")
 
Line 3: Line 3:


== Syntax ==
== Syntax ==
GetCustomAttribute(node, attributeName)
GetCustomAttribute(''node'', ''attributeName'')


== Parameters ==
== Parameters ==
{| class="wikitable"
{| class="wikitable"
|-
|-
| node || [[NXSL: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 [[SG:Security Issues|Security Issues]] for more information).
| ''node'' || [[NXSL: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 [[SG:Security Issues|Security Issues]] for more information).
|-
|-
| attributeName || Custom attribute name.
| ''attributeName'' || Custom attribute name.
|}
|}


Line 22: Line 22:
== Examples ==
== Examples ==


GetCustomAttribute($node, "my_attribute") -> "my value"
GetCustomAttribute($node, "my_attribute") -> "my value"
 
GetCustomAttribute($node, "bad_attribute_name") -> NULL
GetCustomAttribute($node, "bad_attribute_name") -> NULL
683

edits