- 🇳🇿New Zealand quietone New Zealand
This was fixed in 📌 Improve documentation of hook_theme_suggestions_HOOK() Fixed
API page: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21...
IMHO the naming of hook functions in the API docs is confusing/misleading, e.g.
hook_theme_suggestions_HOOK_alter
Perhaps I'm being rather slow, but it took me some time before I realised the opening 'hook' was also a placeholder (for the theme name), not just the one in uppercase. I'd tried both of the following (for my 'test' theme) and XDebug (which not everyone will have setup) indicated they were not being matched:
hook_theme_suggestions_node_alter
test_hook_theme_suggestions_node_alter
when I actually needed:
test_theme_suggestions_node_alter
Could:
- the initial 'hook' also be in uppercase (in the explanatory text in the docs, I realise we can't change the code in core)
- OR it be named something else in uppercase, e.g. THEME/MODULE_theme_suggestions_HOOK_alter
- OR just provide example code with a named theme
Closed: outdated
11.0 🔥
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
This was fixed in 📌 Improve documentation of hook_theme_suggestions_HOOK() Fixed