Overridding theme files inconsistent

Events happening in the community are now at Drupal community events on www.drupal.org.
muzzye@mskcc.org's picture

First of all, thanks for all the work developing Omega; I'm looking forward to working with it on a new site.
I should also say I'm new to Drupal and Drupal7 and am using the latest omega release.

I've come across a situation that doesn't seem to work as I expect it to.
I've created a sub-theme and am trying to override various content on the site by overriding theme pages.

To do this I hooked into theme_preprocess_page on template.php and added theme_hook_suggestions for nodes and pages.
So I now have node--node--9.tpl.php and the file contents I've taken verbatem from node.tpl.php in the omega base theme.

Unfortunately, when this page is available and the node is requested, the page in the browser is pretty empty, there's no context, no menu, etc.

I've done the same thing for a block (though I didn't create a theme_hook_suggestion) so block--block--7.tpl.php does override successfully and content is returned. I can also override with page--type--.tpl.php but this isn't deep enough into the rendered content to suite my needs.

A solution, though I haven't followed it all the way through since it doesn't make sense to do it, is to add all the template files that are higher in the rendering chain to node--node--9.tpl.php. That is, compose a file to have page.tpl.php as well as node.tpl.php and probably render--content.tpl.php etc., down through the chain.

Ultimately I was hoping to replace the user-entered content of a node, though I'm not even sure my approach here is the way to do it.
Thanks

Eric

Comments

This is possible...

himerus's picture

Not sure you need to be using theme_hook_suggestions for any of these core templates...

check out: http://drupal.org/node/1089656
and if your situation DOES in fact need theme_hook_suggestions, check out this issue for D7: http://drupal.org/node/956520

Sorry, not much more than a moment to reply at this point. let me know what you find, and I'm glad to help here were possible.

That was it

muzzye@mskcc.org's picture

That was it, funny I got the block override idea from that same page, but neglected to try the node--id.tpl.php.

Doing it this way omega doesn't get confused.
No theme suggestions needed and I can replace content.

Thanks Jake.

Omega Framework

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: