Layout error when another theme renders a node

Created on 18 April 2024, 8 months ago

Problem/Motivation

Layout template refer to civictheme component namespace causing error when another theme renders a node.

CivicTheme layouts (in civictheme.layouts.yml) define a template for the layout. These templates refer to a child template with:

include '@base/layout/content-layout--single-column.twig

Base namespace is a CivicTheme component namespace so when another theme renders a nodeusing a CivicTheme layout they cannot locate this component because it is a CivicTheme namespace and component.

Twig\Error\LoaderError: Template "@base/layout/content-layout--single-column.twig" is not defined in "themes/contrib/civictheme/templates/layout/layout--single-column.html.twig" at line 19

Steps to reproduce

1. Create a view
2. Create a page display with the settings content of `full posts`
2. Update the display format to show "Full Content" ie the rendered view of the node
3. Generate preview for the view
3. Open the developer console you should see a 500 ajax error with the above error

Proposed resolution

Update the layout templates to have inlined content layout templates. This way we provide the active theme all the required template to render the layout for the node.

πŸ› Bug report
Status

Active

Version

1.7

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia RichardGaunt Melbourne

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024