Lightning Component for Custom Lightning Templates
Lightning App Builder provides flexibility to create custom Lightning pages which can be used in opposite of standard Lightning pages. Even though every standard Lightning page is associated with a default template component, Custom Lightning page template components are useful when you want a customized template for your business needs.
Custom Lightning pages can be created for.....
In order to create custom Lightning Templates for App/Home/Record pages, it is required to implement below interface for each.
Note** Each template component should implement only ONE template interface. Template components shouldn’t implement any other type of interface, such as flexipage:availableForAllPageTypes or force:hasRecordId. A template component can’t multi-task as a regular Lightning component. It’s either a template, or it’s not.
Below is a sample custom Lightning page template component (Component and Design Resources) for Home page that implements "lightning:homeTemplate" interface, which will further expose the custom component in Lightning App Builder for creating custom Lightning page. Here "TempHome.design" resource controls what kind of page can be built on the template by specifying what regions a page that uses the template must have and what kinds of components can be put into those regions.
Now once I have created above component, I should be able to create a new Lightning page for my Home page using above custom component Lightning template. Similarly we can create component templates for App and Record pages just by replacing interface to "lightning:appHomeTemplate" and "lightning:recordHomeTemplate" respectively.
Best Practices to use Lightning Page Template Component: