This version is out of date, covering development from v4.6.0 to v4.7.1. It is maintained here only for inbound reference links from elsewhere. Jump to the current version of aTbRef. |
|
A Tinderbox Reference File : Export Codes : Export Code Scope : Item-based : ^getFor(path | item, attribute[, format] )^ | aTbRef Site Map |
^getFor(path | item, attribute[, format] )^ |
Code Type: | Data Include |
Code Scope of Action: | item |
^getFor( path | item, attribute[,format])^
Gets any attribute you specify for any note you specify via the path. Note that:
^getFor (CurrentFileName, attribute)^
will get any attribute of the file like a root note. You can use just the note name, a partial path or a full path with outline layers being delimited with forward slashes: 'top/middle/bottom/note'
Multiple levels of inclusion are permitted, but cycles are detected and broken.
Color values - regardless of how defined inside the TBX (name, RGB or hex) are exported as hex; e.g #FF0000.If the attribute is of 'date' type then optionally a format string may be cited.
Consider using action code
^value^ can be used to call attribute values, with the additional benefit of being able to apply action code modifications. By using a path modifier to the action code's attribute reference, ^getFor^ can also be substituted for using ^value^.
Examples:
^getFor(Boolean Comparison,Name)^
: Boolean Comparison
^getFor(Boolean Comparison,Color)^
: #000000
^getFor(Boolean Comparison,Created,"*")^
: Tue, 24 May 2005 23:46:03 +0000
^getFor(prevSibling,MyNumber)^
: 42
... and possible substitutions using ^value^:
^value($Name(Boolean Comparison))^
: Boolean Comparison
^value(format($Color(Boolean Comparison)))^
: #00aa00
^value(format($Created(Boolean Comparison),"*"))^
: Tue, 24 May 2005 23:46:03 +0000
^value($MyNumber(prevSibling))^
: 42
^value($MyNumber(prevSibling) + 8)^
: 50
The latter examples show how ^value^ makes it easy to add in transforms on the fly that aren't in the export codes and/or cut down on the amount of export code syntax to be remembered.
Up: Item-based | |
Previous: ^get( attribute[, format] )^ | Next: ^inboundBasicLinks( [start, list-item-prefix, list-item-suffix, end, type] )^ |
Licensed under Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
[See aTbRef CC licence Attribution/Waiver info info]