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.
In order for the theme overrides to work correctly $vars['template_files'] should be replaced with $vars['theme_hook_suggestions'] and the format of the candidate template files changed to 'node__view__' and 'comment__view__' respectively for node and comment view theme overrides. This change for D7 is documented here. I have attached a patch with this change.
Comment | File | Size | Author |
---|---|---|---|
views.patch | 1.82 KB | elliotttf | |
Comments
Comment #1
dawehnerWhat happens here with existing templates. Will they have to be renamed?
I guess yes, see http://api.drupal.org/api/function/template_preprocess_node/6 and http://api.drupal.org/api/function/template_preprocess_node/7
So it's fine to do this for views, too.
Comment #2
elliotttf CreditAttribution: elliotttf commentedYeah, from what little D7 work I've done updating the template file names will be required.
Comment #3
dawehnerOkay this is fine. I added some documentation but this is fine.
Comment #4.0
q0rban CreditAttribution: q0rban commentedRepaired anchor href.