fmx:with

fmx:with can be used as a dedicated XML element or as an attribute. It allows to simplify the use of interpolation as it's possible to shorten those expressions.

Options

Dedicated XML element

<fmx:with fmx:value="model.contact.address" fmx:name="bobo">
  <p>Street: ${bobo.street!}</p>
</fmx:with>
[#-- remember the old variable just in case of a name conflict /]
[#assign oldmodel=model! /]
[#assign bobo=model.contact.address /]
<p>Street: ${bobo.street!}</p>
[#assign model=oldmodel /]

As an attribute

<div fmx:with="model.contact.address" fmx:name="bobo">
  <p>Street: ${bobo.street!}</p>
</div>
[#-- remember the old variable just in case of a name conflict /]
[#assign oldmodel=model! /]
[#assign bobo=model.contact.address /]
<p>Street: ${bobo.street!}</p>
[#assign model=oldmodel /]
<p fmx:depends="model.myTitle?has_content">The following title has been configured: ${model.myTitle}</p>
[#if model.myTitle?has_content]
  <p>The following title has been configured: ${model.myTitle}</p>
[/#if]