I'm using Theme Key https://www.drupal.org/project/themekey to switch automatically between themes dependent on browser and/or OS id.
Now I would like to allow the user to explicitly switch to or from to one or the other theme by clicking a link too. ThePersistant URL
https://www.drupal.org/project/purl module might be helpful for this but how exactly can I go about implementing this?
EDIT 1
I followed Answer 1, added drupal_add_library('system', 'jquery.cookie');
into the already existing function marinelli_preprocess_page(&$vars)
in my template.php
.
I setup two ThemeKey
rules like:
system:cookie = "theme=marinelli" THEME [Marinelli]
and
system:cookie = "theme=skeleton" THEME [Skeleton]
and added following html to my page:
<p><a href="#" onclick="$.cookie('theme', 'marinelli')">Switch to Marinelli</a> <a href="#" onclick="$.cookie('theme', 'skeleton')">Switch to Skeleton</a></p>
But clicking the links, doesn't do anything, seems like I might be missing something or it might not quite work this way because href="#"
doesn't actually reload the page if that was the actual idea...?
Theme Key
becomes obsolete, doesn't it?