Provide twig extensions as alternatives to load site settings easily as full entities

Created on 2 May 2020, over 4 years ago
Updated 21 October 2023, 11 months ago

Problem/Motivation

Site settings currently loads a flat array and passes it to all templates. https://www.drupal.org/project/site_settings/issues/3090054 will give the option to disable this, but a good alternative needs to be in place.

Proposed resolution

Add a twig extension for loading a site settings entity

Remaining tasks

Provide a patch with

  1. The twig extension
  2. An update hook to set the existing loader
  3. (potentially) set the twig extension as the new default for fresh installs
  4. Add appropriate tests

Update the documentation

Release notes snippet

Optionally disable the site settings loader and use twig filters instead to render your site settings, eg
{{ site_setting('site_setting_type_machine_name') }}

📌 Task
Status

Closed: duplicate

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom scott_euser

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024