Hi there,

It seems that the Omega theme does not take into account template files that are to be used for specific content types. While other themes in Drupal 7 will honor the theme template hooks and execute the specific theme file, Omega does not. For example I have used a template file called page--type-view.tpl.php under Drupal 7 within another theme which worked perfectly well. Now that I have built a new theme for my Drupal 7 site I notice that the page--type-view.tpl.php file is being ignored and does not get executed. So creating a custom output for a view under Omega (which this template file would allow) does not seem to be possible). I don't know if this is by design and therefore a feature request, or if this is a bug in Omega and hence a bug report.

I also cannot use the Delta/Context modules for this view change since there is some php logic that has to be executed as part of the theme template file. Any suggestions out there?

Comments

Cellar Door’s picture

First things first (and forgive me if this seems too obvious) is the tpl in the templates folder of your subtheme without being in any other subdirectories? It's come up before that this was the issue so I wanted to check first.

Also - any reason not to use a pre-process function that is page type specific for the custom logic? That could clean things up and make it more maintainable.

christowm’s picture

Cellar,

Thanks for the response. So on point one, yes I had the tpl file listed within the templates folder. When I traced the code execution, it never even bothered with the page--type-view.tpl.php. If I switched to a non-omega based theme, then the tpl file would be executed without any issues. This told me that this particular problem is omega specific and not a drupal problem.

On your second point I ended up placing the desired functionality into the html.tpl.php file since a lot of the desired items were HTML/JS type changes in nature and I don't think that those should go into a pre-process function. Styling content output should live in a tpl file. I suppose I could have placed the desired functionality into a pre-process function but to me that is not a solution but a work-around. Drupal was meant to allow people to build custom tpl files for specific output. In this case Omega ignores template files that are meant for specific page types. Other template files like region--sidebar_first.tpl.php work as advertised in my subtheme, it's just that the page type gets ignored. That functionality is a fundamental feature of Drupal and obviously missing from Omega.

Cheers,
Mitch