I am using SwitchTheme via a URL parameter, like so:
mywebsite.com/?theme=mytheme

But once you get into the site and start doing stuff, eventually you click URL links that no longer contain "?theme=mytheme" and those pages load with the regular default theme, not mytheme.

How can I make it so "?theme=mytheme" stays in the URL when someone enters my website and does things in it?

Comments

duit’s picture

Hi Cablestein, did you figure this out?

duit’s picture

For anyone else looking for the solution - all you need to do is make use of drupal l() function (for your links) and check the permissions.

nateman332’s picture

Version: 7.x-1.x-dev » 7.x-1.0

Doesn't seem to work in IE and Firefox, works fine in other browsers though.

Cory Goodwin’s picture

Status: Active » Needs review

You don't need to keep ?theme= in the url. The theme should (and does on my end) stay persistent.

I'm using the master version. There may be changes from the 7.x-1.0. Perhaps there will be a 1.1 version soon.

nateman332’s picture

It does for me too, but users that aren't logged in don't get to keep the theme past the page the link is on (in firefox and IE).

Cory Goodwin’s picture

I don't have IE so I cannot verify that one. But Firefox (and Chrome) works just fine for me as an anonymous user. I switch the theme with ?theme= and then continue surfing the site with no further changes in the theme.

Are you testing on a fresh install?
Are you using the master version? (This is the one changes will be made to)

nateman332’s picture

Yes, it is a fresh install, but I'm not sure I know what you mean by "master version" (I'm using version 7.x-1.0).

Cory Goodwin’s picture

The master version is the main version of the module. You can clone it with Git but not download it from the website.

I downloaded the 7.x-1.0 version and it still seems to work just fine on my end. I am just trying to help, but I just cannot replicate your bug. On my system I change the theme via the GET command and it stays changed no matter what link is clicked. No links contain theme=.

nateman332’s picture

I am using SwitchTheme via a URL parameter, like so: mywebsite.com/?theme=mytheme
I need to use this parameter because I'm using this module with the "link field" module.

Cory Goodwin’s picture

GET is when we pass parameters in the URL.

Perhaps there is a conflict with your other module. Have you tried disabling it and manually typing in yoursite.com/?theme=THEME. ? And then clicking different links on your site?

nateman332’s picture

Yes, I've deactivated all my modules and then tried to manualy type in ?theme=bartik and it worked until I go to another page.

nateman332’s picture

I've installed the themekey module and I'm now using this instead. (turns out that I couldn't fix the problem)

nateman332’s picture

Status: Needs review » Active