Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I've created a sub-theme and I've tried the following in my page.preprocess.inc file and it doesn't seem to recognize it:
function SUBTHEMENAME_preprocess_page(&$variables) {
print 'TESTING 123';
exit;
}
I've cleared the cache and disabled and re-enabled the theme multiple times and nothing seems to get it to recognize my function.
The weird thing is that my preprocess_html hook is being recognized. Am I doing something wrong or is this a bug in Omega 4?
Thanks,
Steve
Comments
Comment #1
steven.itterly CreditAttribution: steven.itterly commentedComment #2
steven.itterly CreditAttribution: steven.itterly commentedI should mention that I have a custom layout called page-main. I've tried creating a page-main.preprocess.inc file in the layout directory with a MYSUBTHEMENAME_preprocess_page_main(&$variables) {} method in it but that is not recognized either. I got this idea from the following thread:
https://www.drupal.org/node/2081485
Can someone please help?
Comment #3
leolandotan CreditAttribution: leolandotan commentedI'm also experiencing this issue. Tried to copy omega's page.preprocess.inc file and replace my subtheme's .inc, deleted my subtheme's page.preprocess.inc and placed my template_preprocess_page fucntion in my template.php file but still didn't.
Comment #4
leolandotan CreditAttribution: leolandotan commentedI noticed something, I'm currently using Panels Everywhere and when I disabled it, the Omega "system" w/c is the page.preprocess.inc worked. Still figuring out how to fix this.
Comment #5
BillyTom CreditAttribution: BillyTom commentedI've got the same problem. Additionally, I can't use hook_preprocess_page from inside a module or in my template.php either.
Comment #6
BillyTom CreditAttribution: BillyTom commented@ steven.itterly: Do you also use "Panels Everywhere"? This seems to be a known issue
https://www.drupal.org/node/1153184
https://www.drupal.org/node/2408047
Comment #7
steinmb CreditAttribution: steinmb as a volunteer commentedProb. a module like panels or similar that uses hook_theme_registry_alter() to take over the page, like mention in several comments in here.