Allow deprecating theme suggestions

Created on 14 July 2020, almost 5 years ago
Updated 12 July 2025, 1 day ago

Problem/Motivation

Sometimes it is necessary to deprecate theme suggestions. For example, #2831144: Bundle / field name / view mode theme suggestions can conflict needs to remove some of the pre-existing theme suggestions.

Proposed resolution

Allow marking theme suggestions as deprecated.

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Needs work

Version

11.0 🔥

Component

theme system

Created by

🇫🇮Finland lauriii Finland

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

  • Needs change record

    A change record needs to be drafted before an issue is committed. Note: Change records used to be called change notifications.

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.

  • @berdir opened merge request.
  • 🇨🇭Switzerland berdir Switzerland

    Forgot about this. Rerolled, still needs docs update and a change record.

  • 🇨🇭Switzerland berdir Switzerland

    Created a change record and added an example hook_theme_suggestions_HOOK(), do we need to duplicate that into the alter hooks?

    Fun fact on:

    Also unsure what to do about $node/comment->view and the preprocess code.

    In the meantime, we added the mechanism to deprecate $variables['view'] and did that, but only for node and not comment.

    The approach is quite similar, but there we just used 'deprecations' key. I wonder if we should align this, it's not prefixed in a special way, but it won't conflict with a real key.

  • 🇨🇭Switzerland berdir Switzerland
Production build 0.71.5 2024