Newer Version Available

This content describes an older version of this product. View Latest

Creating App Templates

An app template bootstraps the loading of the framework and the app. Customize an app’s template by creating a component that extends the default aura:template template.

A template must have the isTemplate system attribute in the <aura:component> tag set to true. This informs the framework to allow restricted items, such as <script> tags, which aren't allowed in regular components.

For example, a sample app has a np:template template that extends aura:template. np:template looks like:

1<aura:component isTemplate="true" extends="aura:template">
2    <aura:set attribute="title" value="My App"/>
3    ...    
4</aura:component>

Note how the component extends aura:template and sets the title attribute using aura:set.

The app points at the custom template by setting the template system attribute in <aura:application>.

1<aura:application template="np:template">
2    ...    
3</aura:application>

A template can only extend a component or another template. A component or an application can't extend a template.