Restrict sections/templates avaiable on pages of specific Content Types

Created on 15 April 2021, almost 4 years ago
Updated 2 April 2024, 10 months ago

Problem/Motivation

Thinking about medium and big projects where we maybe will have a lot of templates and sections saved on the Section Library, I think that's a good idea to have the opportunity to restrict what templates and sections would be available on pages of specifics Content Types.
Just like Layout Builder Restrictions but for sections and templates.
That could make the authoring process clean and predictable.

Proposed resolution

- Create sections and templates on Section Library
- Manage the display of a Content Type
- Restrict what templates/sections will be available on pages of this Content Types

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡§πŸ‡·Brazil Alana CorrΓͺa

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

Merge Requests

Comments & Activities

Not all content is available!

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

  • πŸ‡ΊπŸ‡ΈUnited States b0b Bethlehem, PA

    +1 for this feature. Or another way to configure this might be to Enable/Disable content types within the Section Library admin.

  • πŸ‡¨πŸ‡¦Canada kpaxman

    What would be *really* neat if it worked *with* Layout Builder Restrictions, and just hid/prevented use of templates that contained elements that weren't allowed.

    As it is, we're probably going to have to figure out how to restrict it to just the content types that have common options. (Can't have people injecting multi-column sections into content types that we don't allow them, for example.)

  • πŸ‡ΊπŸ‡ΈUnited States kevinquillen

    What would be *really* neat - if it worked *with* Layout Builder Restrictions, and just hid/prevented use of templates that contained elements that weren't allowed.

    That would be my suggestion as well.

  • First commit to issue fork.
  • πŸ‡¨πŸ‡¦Canada igorbiki

    Created configuration form that allows selection of content types and/or dashboards where section library is allowed. Idea is to list only view modes that have layout builder enabled per content type, and if there is dashboards enabled. Save changes, and then on preRender check if storage id matches those of saved configuration.

    Implementing this as part of layout builder restrictions may be more complex than this approach.

  • Open on Drupal.org β†’
    Core: 10.2.1 + Environment: PHP 8.1 & MySQL 8
    last update 10 months ago
    Waiting for branch to pass
Production build 0.71.5 2024