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

CoffeyMachine’s picture

Did you make sure to clear your cache after adding the file? ;)

Toxid’s picture

Several times :P I'm quite experienced with themes, but this issue is new to me.

CoffeyMachine’s picture

I 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:

function rubik_subtheme_theme() {
  $items = array();

  $items['comment_wrapper'] = array(
    'path' => drupal_get_path('theme', 'rubik_subtheme') .'/templates',
    'template' => 'object',
  );
  
  return $items;
}
aramboyajyan’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

I'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!