Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#8 | switchtheme.patch | 2.35 KB | enkara |
#7 | switchtheme_none_label_2.diff | 1.67 KB | detly |
#6 | switchtheme_none_label_2.diff | 1.67 KB | detly |
#4 | switchtheme_none_label.diff | 546 bytes | detly |
Comments
Comment #1
klonosPerhaps if we set the label to
<none>
the theme doesn't show on the drop-down? (the way block titles work for example)Comment #2
dltampa CreditAttribution: dltampa commentedThat didn't work
Comment #3
dltampa CreditAttribution: dltampa commentedCan 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
Comment #4
detly CreditAttribution: detly commentedThis 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).
Comment #5
detly CreditAttribution: detly commented...magic label "<none>" is...
Comment #6
detly CreditAttribution: detly commentedOkay, 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.
Comment #7
detly CreditAttribution: detly commentedOkay, 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.
Comment #8
enkara CreditAttribution: enkara commentedThe 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.
Comment #9
RedTop CreditAttribution: RedTop commentedVery interested in this! I want to create a high contrast theme and allow anonymous users to enable that theme using themeswitcher...
Comment #10
geasePatch #8 seems working fine, thanks.
Comment #11
Katrina B CreditAttribution: Katrina B commentedSubscribing. I'd like to see this feature added.
Comment #12
sebby CreditAttribution: sebby commentedthanks enkara,
Big help for me!
Comment #13
midmood CreditAttribution: midmood commentedSubscribing.
This is important cause the module show even the admin theme in the list.