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
Comment #1
lsdoc77 commentedI should say that I also have a module with the same name (tomi).
Is there a posibility that this creates some kind of conflict?
Comment #2
fubhy commentedYou 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.
Comment #3
lsdoc77 commentedI have cleared the caches already..I have tried this a lot of times...
Comment #4
rick hood commentedThis 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?
Comment #5
lsdoc77 commentedWell 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..
Comment #7
chrisgross commentedThis 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.
Comment #8
steinmb commentedUnable to reproduce this.
Comment #9
chrisgross commentedYou know what, you're right. This seems to be a panopoly issue.
Comment #10
steinmb commentedThanks for get to me.