HTML Export: ^value^ vs. ^get^

Tinderbox Icon

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 +0100

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.


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

Up: Import/Export/Formatting
Previous: HTML Export only as an include  Next: Incorrect link counts & prototype links 

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

Quicklinks: Attributes | Action Codes | Export Codes | Designators | Date Formats | aTbRef Site Map

[Last updated: 16 May 2012, using v5.11.1]


Search:

Google search aTbRef for:  


Creative Commons Licence

aTbRef by Mark Anderson is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

[See aTbRef CC licence Attribution & Waiver info]

Made with Tinderbox