I use a number of themes during development, but I need only a couple of them available to the drop-down menu. Can we please have a 'Available in the drop-down menu' checkbox next to each theme name in addition to the custom label field in order to be able to do this?

#259926: Switch to non-enabled themes should be taken under consideration as well I think.

Later on, perhaps we can extent this to allow assignment/availability of each enabled + available theme only to certain roles.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

klonos’s picture

Perhaps if we set the label to <none> the theme doesn't show on the drop-down? (the way block titles work for example)

dltampa’s picture

That didn't work

dltampa’s picture

Can someone add a patch or write a bit of code to add an if statement that would remove any themes from the selection array that has a label of < none > ?

if label = '< none >', do not include the theme label in the array

As you can tell... I am not a developer. This would be a real big help to me right now.

Thanks

David

detly’s picture

Title: Option to select wich of the enabled themes will be available for switching » Option to select which of the enabled themes will be available for switching
Status: Active » Needs review
FileSize
546 bytes

This patch seems to work for me. The magic label "" is hard coded though.

Please note that it's against the 6.x-1.1 release and not the VCS (I don't have my usual set of dev tools on this machine).

detly’s picture

...magic label "<none>" is...

detly’s picture

Okay, this patch is a bit more sensible. It adds a function to check the user-assigned label; if it's "<none>", the theme is ignored (in the init function). It also factors out the list_themes() function call, so that a filtered list is returned for the randomiser and the form generator.

detly’s picture

Okay, this patch is a bit more sensible. It adds a function to check the user-assigned label; if it's "<none>", the theme is ignored (in the init function). It also factors out the list_themes() function call, so that a filtered list is returned for the randomiser and the form generator.

enkara’s picture

FileSize
2.35 KB

The problem with this patch is that the inactive switchtheme themes, are also inactivated in the admin settings, so you can't see the '' themes to activate them if you need it at any time.

This patch adds some more code to solve that problem.

RedTop’s picture

Very interested in this! I want to create a high contrast theme and allow anonymous users to enable that theme using themeswitcher...

gease’s picture

Patch #8 seems working fine, thanks.

Katrina B’s picture

Subscribing. I'd like to see this feature added.

sebby’s picture

thanks enkara,
Big help for me!

midmood’s picture

Subscribing.
This is important cause the module show even the admin theme in the list.