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

fubhy’s picture

Status: Active » Fixed

Hey.. 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.

fubhy’s picture

I just committed that other patch. So checking out a fresh copy of Omega 4.x from git should solve your problem.

michielkenis’s picture

Hi 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!

fubhy’s picture

Yes, 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.

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