We're deprecating the older macros for layouts (layout-macro
and layout-macro-def
) and dialog (template-macro
and template-macro-def
). Use the newer macro
and macro-def
keys instead. For more information, see Reusing Content with Macros.
Deprecated:
template-macro-def (id1) {
content {
template (ID1 text)
}
}
layout-macro-def (habitat-pod-summary) {
params {
param (habitatPod) {
type (HabitatPod)
min (Required) max (One)
}
}
content {
cell-card {
slot2 {
content {
primary {
template ("#{value(habitatPod.name)}")
}
}
}
slot3 {
label {
value ("#{value(habitatPod.price)}")
}
}
}
}
}
...
layout-macro (space-resort-details) {
param (spaceResort) {
expression (result)
}
}
...
template-macro (id2) {
param (x) {
expression (this)
}
param (t) {
literal ("some text")
}
}
New:
macro-def (id1) {
content {
template (ID1 text)
}
}
macro-def (habitat-pod-summary) {
params {
param (habitatPod) {
type (HabitatPod)
min (Required) max (One)
}
}
content {
cell-card {
slot2 {
content {
primary {
template ("#{value(habitatPod.name)}")
}
}
}
slot3 {
label {
value ("#{value(habitatPod.price)}")
}
}
}
}
}
...
layout {
macro (space-resort-details) {
param (spaceResort) {
expression (result)
}
}
}
...
macro (id2) {
param (x) {
expression (this)
}
param (t) {
literal ("some text")
}
}
Learn more about the deprecation stages.