0

I am currently assigning a theme using hook_custom_theme and just allowing the pathing system for .tpl files to override displays that I want to edit by using custom .tpl files. I CANNOT find the correct file name for this path:

(base url)/admin/content/node/article <-- Where in admin, it is displaying all node content types of 'article'.

I think I've tried every combination possible of page, node, article, admin... think I'm going crazy, please help. Other overrides are working just fine. Thank you for sanity check!

  • $vars['node']->type is coming back undefined for this node type. What to do? – user28555 May 29 '14 at 11:57
0

Isn't your admin theme uses a different template.php? I am assuming you try to theme /admin/content/node/article. If so, your active admin theme is where your override should go.

  • Yes the admin theme is activated and has its own templates. The admin theme templates folder has all the .tpl overrides, and other page overrides work just fine like dashboard or editing nodes, but this path just isn't converting to a template. Any suggestions on how to make this path use a custom template specifically? Another way to look at it would be /admin/content/node/(type) . – user28555 May 29 '14 at 11:08
  • To better answer your question: admin has a theme, it's working fine. I am overriding certain page types in that theme with custom .tpl files, those work fine, except for this one. I cannot get the template name correct. Suggestions? – user28555 May 29 '14 at 11:26
  • Provided this is not a view that you are trying to theme, you can add a node preprocess like so: $variables['theme_hook_suggestions'][] = 'node__' . $variables['type'] . '__' . $variables['view_mode']; This will give you a template name of node--node_type.tpl.php – ahimsauzi May 30 '14 at 15:03
  • Thank you ahimsauzi, though as stated above, node is undefined, so the node preprocess is not called even though it is not a view, but a page. I found the answer though and will be providing an answer for those in my situation. Thank you! – user28555 May 30 '14 at 15:27
  • Perhaps this will help: drupal.stackexchange.com/questions/20421/drupal-7-admin-theme. Admin pages are not nodes. – ahimsauzi May 31 '14 at 16:49
0

After way too much research into this, I still have NO CLUE why none of the normal naming suggestions work. Even using the theme_hook_suggestions provided, none of them work on the content type listing pages. No idea why. All other nodes and pages worked fine in admin but for some reason these content type listing pages would not use a different .tpl template.

So, I had to set all of them using theme_process_page hook, then redoing $vars['theme_hook_suggestions'][] to a different page name. Unfortunately, you have to manually set them.

Using Ember theme in admin. Hopefully this saves someone else some time in the same situation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy