hook_theme_suggestions_HOOK & hook_theme_suggestions_HOOK_alter

hook = module name
HOOK = (field/ block/ paragraph ...) 


您的函數 hook_theme_suggestions_HOOK  的確在生成多個模板建議,並且通過將它們放入 $suggestions 陣列並返回,間接影響了排序。Drupal 在處理主題建議時,會按照 $suggestions 陣列中元素的順序從後往前遍歷,找到第一個存在的模板。這意味著:
最後一個添加的建議具有最高優先級。


留言

此網誌的熱門文章

Install Drupal 10 with composer in XAMPP htdocs OR PHP Command

fix drupal 11 install error

[custom block module]Correcting Heredoc Syntax and Attaching JS