I am using the switch theme module to allow mobile users to switch to the desktop theme if they like. I used the code from the README.txt and it did not work:

print l('Red theme', $_GET['q'], array(), 'theme=red');

would print a link, but the value of the href on the anchor was simply the node you were on:

<a href="content/home">Red theme</a>

I have changed the code to:

print l('Red theme', $_GET['q'], array('query' => array('theme' => 'red'))); 

and it properly appends the query to the URL.

<a href="content/home?theme=red">Red theme</a>

*I am sure this will not work when viewing a page with a query already on the URL such as a paged view, but that use case is not happening in my situation.

Comments

sun’s picture

Status: Active » Fixed

Thanks! Fixed.

Status: Fixed » Closed (fixed)

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