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 have a layout called mytheme-layout.tpl.php and I would like to access some custom variables. But I'm not sure where and how I can create those custom variables? Normally, you have some preprocess functions to handle this kind of issues, but for some reason, it's not working here.
I saw Omega comes with a standard preprocess directory which has some files included, by default. Do I have to create a new file here and try to add my variables there?
Or how does this preprocessing work in Omega4 since there is very limited documentation about it...
Thanks!
Comments
Comment #1
fubhy CreditAttribution: fubhy commentedHey.. You might've discovered a bug... I just posted a patch at #1906930: Inform Panels about Omega Layouts which is actually a completely different issue but as part of that patch I changed the theme hook names for layouts. I think the problem you are having is that the hook names use dashes currently although they should use underscores. You can either fix that by renaming your layout to use underscore or apply that patch.
Comment #2
fubhy CreditAttribution: fubhy commentedI just committed that other patch. So checking out a fresh copy of Omega 4.x from git should solve your problem.
Comment #3
michielkenis CreditAttribution: michielkenis commentedHi fubhy,
Thanks for your feedback! So if I ceck out a fresh copy of Omega 4.x, I should be fine?
Or do I still have to replace the - with _?
Thanks again!
Comment #4
fubhy CreditAttribution: fubhy commentedYes, I actually fixed that just today (sorry for the confusion... forgot to commit my patch for that). It should work now when you pull again. I also made it possible to create preprocess functions directly in the layout folder.
If your layout is called "divine-layout" you can create a preprocess function by placing "divine-layout.preprocess.inc" in your layout's folder and having a YOURTHEME_preprocess_divine_layout() function in it.