I am trying to create a preprocess node function for an omega based theme that I am creating but it doesn't work either if I create a tomi_preprocess_node function inside teamplate.php , or if I create a preprocees-node.inc in the preprocess folder and a function tomi_alpha_preprocess_node (tomi is the name of the theme).
Strangely enough the tomi_preprocess_region I have inside template.php works perfectly...!!

Comments

lsdoc77’s picture

I should say that I also have a module with the same name (tomi).
Is there a posibility that this creates some kind of conflict?

fubhy’s picture

Status: Active » Fixed

You need to clear the cache after adding a new hook. However, naming the theme the same as a module is a really bad idea and you shouldn't do that, ever. It can cause a lot of conflicts on the long run.

lsdoc77’s picture

I have cleared the caches already..I have tried this a lot of times...

rick hood’s picture

This working OK for me (7.x-3.0):

function cmi_alpha_preprocess_node(&$vars) {
--- code here ---
}

in: sites/all/themes/cmi/preprocess/preprocess-node.inc

(where 'cmi' is my subtheme name (omega-html5 starterkit))

Maybe check spelling of things and/or put your function here?

lsdoc77’s picture

Well finally the problem is context module.. If in a context I add a condition of content-type=something then the preprocess_node function is not working for this specific content-type..If I disable this context or remove the condition preprocess is working again..
Already posted it in context's issues..
Thanks for the answers..

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

chrisgross’s picture

Version: 7.x-3.0 » 7.x-4.4
Category: Support request » Bug report
Priority: Normal » Critical
Issue summary: View changes
Status: Closed (fixed) » Active

This issue is not context's fault and it still exists in 4.4. My omega subtheme does not recognize template_preprocess_node at all, regardless of whether it is in node.preprocess.inc or template.php.

steinmb’s picture

Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

Unable to reproduce this.

chrisgross’s picture

You know what, you're right. This seems to be a panopoly issue.

steinmb’s picture

Status: Postponed (maintainer needs more info) » Fixed

Thanks for get to me.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.