Template Components

In Nova, everything is a component, including the templates themselves.

These special components aren't actually all that special, these are just the components the templates registered on the PHP side correspond to. There's nothing different about their structure of functionality from within the style guide.

See Template Interceptor and Template Configuration to get started on why these are important in WordPress.

Creating template components

Begin by scaffolding out the component following the template-${template-slug} convention. Use existing template components as references for <TemplateWrapper /> usage and other established patterns.

Next you'll need to add your new template to the brand's Template Configuration.

And that's it, you can navigate to a WordPress route that resolves to your template.

Frequently asked questions

What are the use-gutenberg-content hooks?

The use-gutenberg-content hooks are found in some templates and provide a solution to mocking components rendered via the pmc_nova_gutenberg_content hook in PHP/WordPress.

These hooks support returning different mock components based on the template and brand context.

For example, this is what allows us to have different previews for the homepage for each brand.