What’s a Theme Layout?
A theme layout is the top-level layout for the template pages (1) in your community. It includes the common header and footer (2), and often includes navigation, search, and the user profile menu. The theme layout applies to all the pages in your community, except the login pages.
In contrast, the renamed content layout (3) defines the content regions of your pages, such as a two-column layout.
How Do Theme Layouts Work?
Previously, you couldn’t modify the Template Header region of a Customer Service (Napili) template, apart from editing the properties of the components within it.
Now developers can create a custom theme layout component in the Developer Console that implements the forceCommunity:themeLayout interface. When the component is ready, you simply select the new theme layout (1) in. And presto-chango, all the pages in your community are transformed!
And if your developer creates a custom search component (using the new forceCommunity:searchInterface) or a custom user profile component (using the new forceCommunity:profileMenuInterface), you can swap them out too. Select Use a custom search component or Use a custom user profile component (2) and choose the custom component you want.
Because a theme layout is a Lightning component, you can package it in the same way as standard Salesforce components, using the same tools. Select Lightning Component Bundle as the package component type, add the theme layout component and any custom search or user profile components, and you’re good to go.