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

exportedString("item",template)


Operator Type: 

Operator Scope of Action: 

Operator Purpose: 

Operator First Added: 

Operator Altered: 

 Function   [other Function type actions]

 Item   [operators of similar scope]

 Formatting   [other Formatting operators]

 Already in v5.0.0

 


The operator exportedString() applies an export template to a note, returning the result as a string. The second template has 2 forms.

exportedString("item",templateFile)

exportedString("item",templateString)

item designates the note to be exported; it is commonly "this". It is a note name, path or item designator. An attribute may not be used as a placeholder for such information.

templateFile is an HTML export template or a text export template; this argument is evaluated allowing use of attribute values and expressions. If both an HTML export template and a text export template exists with the same name, the HTML template will be used.

templateString is the name of an attribute holding a string of actual template code (i.e. what would normally be the contents of a template), which is then applied to the target note. The attribute reference cannot use a path extension to refer to a different note, $ExportCode is OK, $ExportCode(Another note) will fail.

If the template name includes spaces or periods then enclose the name in double-quotes.

The exportedString() operator is especially useful in conjunction with the runCommand() operator. You can use exportedString() to assemble the input an external program will require, and then pass that input to the external program.

If you simply wish to transform a string or attribute value (e.g. $Name) into a 'safe' value for use as an HTML/XML element 'id' value, use idEncode().

exportedString(note,templateFile)

The first form of exportedString takes a reference to a note and the name of a template note or external file in the HTML Export Template folder, and returns the result of applying the template to the note.

exportedString(note,templateString) 

The second form requires no external file; instead, its second argument is the template string itself.

exportedString(this,^value($Name(parent))^) 

or

exportedString(this,$MyTemplate) 


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


A Tinderbox Reference File : Actions & Rules : Operators : Action Operator Functional Types : Function actions : exportedString("item",template)