Code Type:
Code Scope of Action:
Code First Added:
Code Altered:
^include( item|group )^
Includes a single item or note (with its default template) in the web page for the current note. From v5.9.2, the scope may be group scope instead, either from an attribute holding a list of paths or a function returning such a list.
^include( item|group, template )^
Includes the item or group using the specified export template rather than each note(s)' default export template. for instance is a note is set to export a complete page, the default would be inappropriate where the note's output is to be used embedded in another page. In the later case, it is necessary to specify a template that simply returns inline content markup.
IMPORTANT: Tinderbox will not generate HTML links for internal links that point to notes that are only exported via the ^include method; consider linking to the note's (export) parent note instead.
Syntax
A quoted string literal can be used with either a single item or a group (list):
^include("a note")^
^include("a note;another note")^
For simple expressions such as string concatenations - which are actually considered expressions, an additional ^value()^ wrapper is needed:
^include(^value("Some"+" note")^)^
--> include note "Some note"
If a stored attribute value is used, group assignments must be enclosed in a ^value()^ code whereas they aren't needed for item assignments:
^include($MyString)^
^include($MyString("Some note")^
^include(^value($MyList)^)^
^include(^value($MyList("Another note"))^)^
Expressions must take a ^value()^ wrapper. The most common use with an expression is a find():
^include(^value(find(inside(Some note)))^)^
^include(^value(find($Text.contains("Nelson")))^)^
The optional second argument specifies the export template to use when including is evaluated. This permits parameterised constructions like the following:
^include(^value($StringAttribute(ItemNameOrPath))^,^value($TemplateName)^)^