Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 298690

hook_theme() docs for path are inaccurate

$
0
0

API page: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21...

The docs for this say:

path: Override the path of the file to be used. Ordinarily the module or theme path will be used, but if the file will not be in the default path, include it here. This path should be relative to the Drupal root directory.

But this is not quite true. As seen in Drupal\Core\Theme\Registry:

   *   In case of a theme template file:
   *   - path: The path to the template file to use. Defaults to the
   *     subdirectory 'templates' of the path of the extension implementing
   *     hook_theme(); e.g., 'core/modules/node/templates' for Node module.

It's a 'templates' subfolder in the module.


Viewing all articles
Browse latest Browse all 298690

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>