I have an interesting problem. I use the sections module to change the theme on some pages. It simply changes the theme (global $custom_theme variable) in hook_init(), nothing fancy.

The problem is with ajax views, that they do not apply my theme settings in the result, they do not use the $custom_theme variable.

example:
I have mytheme_tablesort_indicator($style) function in my template.php file and have a views-exposed-form.tpl.php template file in my theme directory. These setting are ignored from the result of the ajax view. It uses the default theme settings, it loaded views-exposed-form.tpl.php template file from the default theme.

What could I do to affect the theme used for ajax view?

Comments

merlinofchaos’s picture

I suspect the problem has to do with how sections module is setting the theme, which is by path. But AJAX events happen on their own path, unrelated to the page.

The only thing I can think is that there would need to be some additional code to maybe check which view is in use (or worse, look at the arguments).

Another solution is to use a single base theme and then have your sections simply be child themes; then your base theme can have all the views templates and your child theme would (hopefully) just need alternative CSS. Then it would not matter which theme got chosen by sections module since the CSS is already applied on the page.

domesticat’s picture

Status: Active » Closed (fixed)

Closed while closing all Views support requests with no activity for 6 months. If you still need help, you may re-open this issue at any time.