Include - AppDaddy-Software-Solutions-Inc/framework-markup-language GitHub Wiki
<INCLUDE/> : Widget
The <INCLUDE/>
widget takes an external xml file and inserts it into the FRAMEWORK
that houses the INCLUDE
. It is important to remember that the widgets within an INCLUDE
file must be treated as if they were written within the template, and thus must follow the FML rules, such as unique id
's.
INCLUDE
is best used to insert a repeatedly used piece of FML into multiple templates, or to lower the clutter of a single template by breaking it into functional parts.
- Used to break complex templates into manageable parts.
- Used to share a set of bindings across multiple templates.
- Reuse a single file across multiple templates to reduce editing time, such as
HEADER
's - Pass in attributes using the
url
.
- An
INCLUDE
should be treated as if its file was written within the template it is included in. -
INCLUDE
should never use the sameurl
twice within a template, unless NOid
's are present within the file. - The
INCLUDE
document should always be wrapped in<FML>
tags on the outermost level.
Name | Type | Default | Description | Req |
---|---|---|---|---|
url | string | true | The visibility of the widget. | |
exclude | bool | false | If the widget is excluded. Is not mutable once the template is loaded. |
An XML example of a INCLUDE
being used to include color bindings.
<FML>
<INCLUDE url="templates/colors.xml" />
<BOX center="true" color="{stcol}">
<BOX height="50%" width="50%" radius="20" color="{tcol}" center="true">
<TEXT style="h6" color="{hcol}" value="_Colors Included_" />
</BOX>
</BOX>
</FML>
<!--The included file-->
<FML>
<VAR id="tcol" value="#5dae6e" />
<VAR id="stcol" value="#29533a" />
<VAR id="hcol" value="#3F4347" />
</FML>
An XML example of a INCLUDE
being used to include a visual footer.
<FML>
<INCLUDE url="resources/templates/[email protected]" />
</FML>
<!--The included file-->
<FML>
<FOOTER height="35" >
<BOX color="white" width="100%" height="100%"/>
<POSITIONED right="20" top="0">
<IMAGE url="resources/images/fml.svg" height="30" opacity="0.5"/>
</POSITIONED>
<POSITIONED left="10" bottom="9">
<ROW expand="false">
<TEXT style="caption" size="12" value="For assistance email" />
<BOX width="5" height="0"/>
<TEXT style="button" size="12" value="{email}" color="green" />
</ROW>
</POSITIONED>
</FOOTER>
</FML>