Templates

This document explains Templates in Mosaic, detailing how they structure content within a Master layout. Templates can be automatically or manually assigned to pages and customized with conditions. You’ll also learn about template types, prioritization, and how to manage and edit templates for different content types.

Mosaic template inside a Master layout, where each section is clearly hihglighted.

In Mosaic, a template shapes how content is displayed on a website. It works within a Master which surrounds the content of the template. Each template is also assigned a specific type, determining its role and where it appears in response to user requests, for example, homepage, blog archive, or post. Templates can be customized with unique conditions. For instance, certain templates might only be visible to users who are logged in.

Template ↔ Master

A Master functions as a reusable parent layout, providing a consistent structure for multiple templates. This means that a Template cannot exist without a Master. This inheritance model ensures uniformity and coherence in the overall design, aligning with the design principle of consistency. You can also recognize when you are editing a Template by the blue highlight color used for its scope.

Assignment

Templates in Mosaic are usually automatically assigned. Take, as an example, the post template used for displaying individual blog posts with dynamic content.

Moreover, Mosaic also offers the flexibility to manually assign a template to a specific page. This is particularly useful for landing pages, like an About page. You can create a new template and manually assign it to the desired page. These templates are often highly customized and are not reused for other content on the site.

Mosaic template assignment screen showing how a custom template can be manually assigned.

Template type

In Mosaic, each template is assigned a specific type. This template type is used to serve user requests when the template is automatically assigned. It is also the context that determines what Variables are available in the Editor.

For example, if the post type is Single post, you will have access to Single post variables, like the post Title, Excerpt, and so on.

Mosaic template settings screen showing a Single post template type.

The following is a list of available template types.

Post

  • Single Post: This template is used to display a single blog post or article.
  • Homepage – Post Archive: This template displays a collection of recent posts in an archive format. This option only appears if the “WordPress Settings → Reading → Your homepage displays” is set to “Your latest posts”. Otherwise, if it is set to a custom page, you will need to make a template for that page.
  • Categories Archive: This template organizes posts based on their assigned categories. It creates a page where users can explore content specific to a particular category.
  • Tags Archive: Similar to the categories archive, the tags archive template organizes posts based on assigned tags.
  • Formats Archive: The formats archive template organizes posts based on their assigned formats.
  • Author Archive: This template displays a collection of posts authored by a specific individual. It serves as an author profile page, showcasing their contributions.

Page

  • Single page: This is similar to the single post template but is designed for individual pages rather than blog posts.

Media

  • Single media: If your site includes media items like images, videos, or audio files, this template is used to display a single media item with relevant details.

Other

  • Search result: When users perform a search on your website, the search result template displays a list of relevant posts or pages based on the search query.
  • 404 Not found: This template is shown when a user tries to access a page that doesn’t exist. It usually provides a user-friendly message indicating that the requested content could not be found.

Fallback

  • Inactive – Homepage fallback: If your homepage is set to display a static page and that page becomes inactive or is deleted, this fallback template may be used to show an alternative homepage or a default message.
  • Single fallback: Similar to the 404 template, but is used for individual posts or pages that are no longer available or have been deleted.
  • Archive fallback: If an archive page (like categories or tags) has no content to display, this template may show a fallback message or default content.
  • Empty: A generic template, used for cases where there is no content to display, often accompanied by a message indicating the absence of content.

Managing templates

To create or edit templates, first open Mosaic and then locate Templates in the menu.

Templates section in Mosaic’s main menu displaying a list of existing templates with options to create or edit them

In this interface, you’ll see a list of your Templates. You can create new templates here or edit the settings of the existing templates. By selecting a template, you will be directed to its Editing interface.

For more options, use the Context menu accessible via the three dots on each Template. This menu allows for various actions:

Context menu for a template in Mosaic showing management actions like edit, duplicate, assign, or delete
  • Settings: In the settings, you can customize the template name, assignment, and template type, choose a Master, and add conditions as needed.
  • Duplicate: Use this to create a copy of an existing Template.
  • Generate thumbnail: You can generate a small sneak peek of what is going on inside the Template, allowing you to view its content without the need to open it. Helpful when managing many or similarly named ones.
  • Delete: Permanently delete a Template. Use this option with caution as deletion is irreversible.

Template settings

In the settings, you can customize the template by renaming it, selecting an assignment mode and the template type, choosing a Master, or adding conditions as needed.

Template settings popup in Mosaic allowing customization of name, assignment mode, template type, Master selection, and conditional rules

Template conditions are a powerful feature that allows you to control when a specific template file is used. These conditions are based on various rules. For example, you may want to apply the template only when the user on your website is logged out or apply the template to only those posts that have a certain category. Refer to Template conditions for a direct example.

Post & Page assign

Edit with Mosaic

In the WordPress interface, there are several places where you can find the Edit with Mosaic button and link. For example, in the pages view or in the Gutenberg page editor.

Depending on whether the page has a local template assignment, it will perform different actions:

  • No assignment: Shows the modal to set Template assignment for this page.
  • Has assignment: Takes you to the Template editor.
Edit with Mosaic button shown in the WordPress interface, available in the pages list and Gutenberg editor for quick access

Template assignment

You can select what type of template you would like to use for the chosen page.

Template assignment interface in Mosaic allowing users to select the desired template type for a specific page
New template

This option lets you swiftly create a new template directly from the page. It’s a manual process where you define which Master the template will be assigned to. Mosaic will also manually assign the template to this specific page.

Existing templates

You can also choose to apply an existing template to this specific page. This method is similar to creating a new template but involves using an already-created template for this individual page instance. In this case, the template is manually assigned to this instance as well.

Auto template

Alternatively, you can assign a template that is automatically applied to every instance of this page type. By adjusting the order and applying specific conditions, you can control which template is automatically assigned.

As an example, imagine that you have a Service page template that automatically applies to all new service pages that you create. This ensures that all new service pages follow the same design and structure. You can also set conditions to further customize which template is applied to specific types of pages.

Additionally, if an automatically assigned single-page template does not exist, Mosaic will just create it for you.

Warning message in Mosaic notifying that a missing auto-assigned single-page template will be created automatically

Change template

If a page already has a template assigned, it will open in the Editor with that template applied. To switch to a different template, use the Change template button. You can also reassign a template from the Gutenberg right sidebar.

Mosaic Editor showing a page with an assigned template and the Change template button.

This will start the same flow as Edit with Mosaic.

Prioritize templates

The order of the templates for a given Template type is crucial for automatically assigned templates. If you have multiple templates with the same template type and different conditions, you need to prioritize the template with the more specific condition. You can change the order of the templates by simply dragging and dropping them into the desired sequence.

Templates list in Mosaic with highlighted order

As an example, imagine you have two different templates for your posts, both of which are automatically applied, but one of them has a condition that it should only be applied when the post belongs to a specific category. If your template with the condition is placed after the first template without any conditions, it will never be evaluated, as the other gets applied immediately. To resolve this, you should prioritize the template with the condition before everything else.

Template conditions

To set custom conditions for when a template should be applied, click on the conditions icon in the template creation settings. This will open a dropdown where you can select a specific rule.

Conditions icon highlighted in Mosaic’s template creation settings

Once you choose a rule, the Conditions interface will open, allowing you to customize it further to fit your needs.

Conditions interface in Mosaic opened after selecting a rule, allowing detailed customization of template assignment logic

As an example, let’s say you want to create different homepages depending on the visitor’s logged-in status. You can achieve this by:

1. Selecting a rule

  • Click on the conditions icon and choose the User logged in (WordPress) rule from the dropdown.
Conditions dropdown in Mosaic with 'User logged in (WordPress)' rule selected for setting template assignment conditions

2. Adjusting Operator & Value

  • Set the Operator (always is in this example) and the Value (e.g.: Logged out).
  • By setting these conditions, the template will only be assigned to the Homepage if the specified condition is met. In this example, when the user is logged out.
Condition settings in Mosaic showing Operator set to 'is' and Value set to 'Logged out' for template logic

3. Add additional conditions

  • You can add more conditions as needed, such as setting an And relation between conditions by clicking the + icon
Plus icon highlighted in Mosaic’s Conditions interface
  • or setting an Or relation by clicking the Add condition button.
Add condition button highlighted in Mosaic’s Conditions interface
Notice

As mentioned previously, it’s important to note that the order of the templates matters for these conditions to work correctly. For instance, the membership version of the Homepage template must be positioned before the regular Homepage template to ensure that the condition can be evaluated properly.

FAQ

Last updated: September 11, 2025

Still have more questions? Let us help!

We use cookies to improve your experience, analyze traffic, and personalize content. By clicking "Accept all" you agree to storing them on your device. Read our privacy policy.

Accept all
Reject all