Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When a site has a large quantity of views it can make organizing them and remembering what they do difficult. However it is possible to create a sub-directory inside the theme directory and organize the template files in a sub-directory. If a site has many views it is possible to further separate these into additional sub-directories.
This is one possible structure:
theme_root
+ views
+ view_name
+ display_name (with template files inside)
+ another_display_name (with template files inside)
+ another_view_name
+ display_name
When the theme registry is cleared, the sub dirs will be registered as containing the template files.
Comments
and node view ?
is it possible to store the node-view-nameoftheview.tpl.php in these folder too ?
If it's possible, which name to choose for the template ?
Doesn't look like it -
Doesn't look like it - they've got to go with node.tpl.php
Rescan Views Templates
It is important to note that if you move views templates into a views folder, you will need to go back and click 'rescan templates'. This is found on the actual view edit interface. Lower left look for 'Theme: Information'.
Is it possible to have
Is it possible to have .tpl.php files with the same name in those different directories?
Would it be possible to have something like this?
Block template folder
Is this possible with Blocks also?