We have a site that is using page_theme to switch themes. We have one page which includes a view (which is embedded via a panels-pane... I'm not sure if that part is relevant). The view has an exposed filter, and the view is set to "Use AJAX: Yes".

What happens is that when the page first loads, the correct theme is applied (a different theme from the default one, which page_theme nicely switches us to). But when you filter the list, the theme half-changes back to the default theme. That is, because the whole page doesn't reload, the overall page structure does not change to reflect the default theme, but some CSS files for the default theme are loaded, changing how the page looks.

I used LiveHTTPHeaders in Firefox to watch the calls to the webserver. Normally, you call a page such as "my/page_theme/controlled/page" first, and then you see subsequent calls for css and js files from the non-default theme. But when you use views & ajax, the initial ajax call goes to "views/ajax?....", and then you see subsequent calls for css and js files being made from the *default* theme directory.

So my temporary kludge was simply to add the url "views/ajax*" to the list that page_theme is watching for, so that all views-ajax will invoke my non-default theme. This is ok for now, but if we have a view somewhere else on the site, somewhere where you expect it to use the *default* theme, then we'll have the problem in reverse... that is, loading css/js files from the non-default theme on a page that should be rendered with the default theme.

Anyone have a better solution?

Comments

tutumlum’s picture

subscribing...
If the page has ajax it fails.

rstamm’s picture

Status: Active » Postponed (maintainer needs more info)

cannot reproduce. built different views pages using ajax and all work fine.
which modules do you use?

tutumlum’s picture

Gradebook module. It has ajax at grade entry page. I solve my issue by using in reverse. I mean I set the theme I want to use with gradebook as default and I configure the usage of Garland ;)

rstamm’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Release 6.x-1.1 includes now a debugging tool. Please check it out.