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.
Hello! I'm trying to override the object.tpl file through a subtheme, so I've placed a copy of the object.tpl in my subtheme/templates folder. Still, rubik uses the one in rubik/templates. I tried changing this in my rubik_subtheme_theme function:
$items['comment_wrapper'] = array(
'path' => drupal_get_path('theme', 'rubik') .'/templates',
'template' => 'object',
);
// Changed into
$items['comment_wrapper'] = array(
'path' => drupal_get_path('theme', 'rubik_subtheme') .'/templates',
'template' => 'object',
);
So that it looks in the right folder for object.tpl, but even after this it still uses the one in rubik/templates.
Does anyone know how to override it?
Comments
Comment #1
CoffeyMachine CreditAttribution: CoffeyMachine commentedDid you make sure to clear your cache after adding the file? ;)
Comment #2
Toxid CreditAttribution: Toxid commentedSeveral times :P I'm quite experienced with themes, but this issue is new to me.
Comment #3
CoffeyMachine CreditAttribution: CoffeyMachine commentedI was able to reproduce this. This is something I will need to look into to see how to write that theme function differently to allow proper overriding.
I'm not sure why it didn't work for you when you overrode the theme function. I was able to make this work by overriding the theme function in my rubik_subtheme/template.php file
This is the code I used:
Comment #4
aramboyajyan CreditAttribution: aramboyajyan commentedI'm closing this issue as it's pretty old, and because #3 is a way around this.
Feel free to reopen if this needs to be fixed in Rubik though.
Thanks!