Improve the documentation of 'pattern' in hook_theme.

Created on 11 January 2024, 11 months ago
Updated 19 July 2024, 5 months ago

Problem/Motivation

The doc block for hook_theme includes 'pattern' which doesn't seem to be used anymore. Therefore, it can be removed.

 *   - pattern: A regular expression pattern to be used to allow this theme
 *     implementation to have a dynamic name. The convention is to use __ to
 *     differentiate the dynamic portion of the theme.

Discovered this in consultation with larowlan while working on 📌 Remove usage of forum module from comments and strings Fixed , which used 'forum' as an example for the pattern.

Steps to reproduce

Proposed resolution

Remove the entire description for 'pattern'

   - pattern: A regular expression pattern to be used to allow this theme
 *     implementation to have a dynamic name. The convention is to use __ to
 *     differentiate the dynamic portion of the theme. For example, to allow
 *     forums to be themed individually, the pattern might be: 'forum__'. Then,
 *     when the forum is rendered, following render array can be used:
 *     @code
 *     $render_array = array(
 *       '#theme' => array('forum__' . $tid, 'forum'),
 *       '#forum' => $forum,
 *     );
 *     @endcode

Remaining tasks

Confirm it is not used
Create an MR

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Theme 

Last updated about 19 hours ago

Created by

🇳🇿New Zealand quietone

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

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.

Production build 0.71.5 2024