uhm yes, maybe it would be nice to add to the readme.txt that the different themes can be switched also with links of the type:

http://example.com/?theme=themename

nice mod!

Comments

sun’s picture

Title: Switch theme with call » Document query string feature
Cory Goodwin’s picture

If you use this code to switch the theme, how do you return them to the previous page viewed?

ex: I am on /node/22 and I click a link to change themes with /?theme=themename. I am redirected back to the home page, but I it would be better to be kept on the same page I was viewing.

sun’s picture

@DonCoryon: Please apply the patch in #185254: Themes don't switch for anonymous users and report back (there) if your issue is still valid then.

Cory Goodwin’s picture

It didn't work for me. Module functioned the exact same as it did before the patch.

I am not concerned about anonymous users switching themes. I am trying to mimic the color module, since my theme of choice isn't setup for the color module. I have four different colors for my theme. I use the included block currently but I would like to stop using the block and instead using little color boxes at the top of the screen that link to the different themes.

The mod works 100% for me. I am just curious to any coders if it's possible to do this:

instead of a link like this http://www.mysite.com/?theme=themename

to change it to this with PHP:

(PHP=current page) append to end = &theme=

sun’s picture

@DonCoryon: That's slightly out of scope for this issue. You may try to put

$image = 'foo'; // your image HTML markup here.
print l($image, $_GET['q'], array(), 'theme=red', NULL, FALSE, TRUE);

into your page.tpl.php to display a link pointing to the current page, but switching the theme. Use at our own risk, and please don't follow-up in this issue.

sun’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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