Bixby Developer Center

References

template-macro

optionalvalue required

Encapsulates dialog logic that normally would lead to duplication.

Note

This key will be deprecated in a future release. You should switch to using generic macro and macro-def keys instead to create dialog macros. For more information, see Reusing Content with Macros.

Template macros enable you to change a macro definition once instead of having to update dialog in multiple places.

Example

dialog (Result) {
match: MyCapsule.MyConcept (this)
template-macro (MyAwesomeMacro) {
param (concept) {
expression (this)
}
param (string2) {
literal ("some text")
}
}
}

You must qualify template macros that you import, but not those that are local to your capsule. Put simply, you must follow the same name-spacing rules that apply to model references.

Take, for example, a capsule called example.capsule1 that defines template macro template1. If you want to import template1 into another capsule called example.capsule2, you must fully qualify it as shown here:

template-macro (example.capsule1:template1)

However, if you want to use that same macro within example.capsule1 itself, you should use the unqualified notation:

template-macro (template1)

You can also use an alias to qualify template macros. For example, if example.capsule2 imports example.capsule1 as aliasedcapsule, you can then invoke a macro within it using the alias:

template-macro (aliasedcapsule:template1)

For more information on macros, refer to Reusing Content with Macros.

Child Keys

param
optional
Parameter to which the argument (specified as a child) should bind