This version is out of date, covering development from v5.0.0 to v5.12.2. It is maintained here only for inbound reference links from elsewhere.

Jump to the current version of aTbRef.

Tinderbox Icon

HTML Export: ^value^ vs. ^get^

Since v4 guidance is to shift to export attribute values using ^value($Attribute)^ rather than ^get(Attribute)^ and ^value($Attribute(Some note))^ rather than ^getFor(Some note, Attribute)^. Since v5.7.0, ^get^ and ^getFor^ are now deprecated.

Do be aware that to get the expected value in the exported data some attribute data types, especially Date and Color require the attribute value to be enclosed in a format() call:

^value($Color2)^: dark warm gray dark

^value(format($Color2))^: #403a35

^value($Created,"*")^: 07/01/2010, 10:46

^value(format($Created,"*"))^: Thu, 7 Jan 2010 10:46:00 +0000

An added advantage of the ^value^ method is that the exported value is an evaluated expression so it is possible to manipulate attribute data. If $MyNumber is 5:

^value($MyNumber)^: 5

^value($MyNumber*3)^: 15

Note that the evaluated result is only seen in the exported code; the source attribute(s) aren't affected.

Compared to old methods like ^text^ and ^title^, ^value^ does not evaluate any inline ^ export code in $Text or $Name - for instance macros, linkTo and include codes. In such context, trying ^value(eval($Text))^ doesn't help as eval() evaluates action code rather than export code.

Referencing a template's attributes. Unlike all other notes, in an export template (i.e. $IsTemplate is true), referencing an attribute refers to the note being procesed and not the template. To refer to the template is it's path or name, thus $AttrName(template-name) not $AttrName.

Possible relevant notes (via "Similar Notes" feature):

A Tinderbox Reference File : Import/Export/Formatting : HTML Export: ^value^ vs. ^get^