The following code should give the default theme:

variable_get('theme_default', NULL)

However, given that ThemeKey dynamically changes the theme, then is there a way to obtain the name of the current theme rather than the default theme?

CommentFileSizeAuthor
#1 1236886.patch904 bytesmkalkbrenner

Comments

mkalkbrenner’s picture

Category: support » feature
Status: Active » Needs review
StatusFileSize
new904 bytes

The variable 'theme_default' always contains the default theme not the current theme.

Using the patch attached you can see the current theme if you enable the "ThemeKey Debug" module.

mkalkbrenner’s picture

Title: How to obtain name of current theme? » show current theme using ThemeKey Debug
Version: 6.x-3.3 » 7.x-1.x-dev
Assigned: Unassigned » mkalkbrenner
Status: Needs review » Patch (to be ported)
cyrus.rezai’s picture

Hi Markus,

Sorry for the late reply. Thanks for the patch. Do you intend to port this feature to the core Themekey module?

mkalkbrenner’s picture

It's already comitted to git for 6.x-3.x and will be part of ThemeKey 6.x-3.4.

But it needs to be added to 7.x-1.x as well.

cyrus.rezai’s picture

Status: Patch (to be ported) » Closed (fixed)

Great. Thanks for your response.

mkalkbrenner’s picture

Status: Closed (fixed) » Patch (to be ported)
mkalkbrenner’s picture

Status: Patch (to be ported) » Closed (fixed)

committed to 7.x-1.x

fejn’s picture

Version: 7.x-1.x-dev » 7.x-2.0
Category: feature » support

Hi,

It's good you've made Themekey Debug available to get the current theme; is there any way to determine which rule triggered the selection of that theme in the Themekey Rule Switching Chain (I can make a guess at it, but with 5-10 rules it can be hard to determine which rule actually caused the selection).

Thanks,

Jeff

mkalkbrenner’s picture

Simply enable 'Trace ThemeKey rule switching' in ThemeKey Debug.

fejn’s picture

Thanks loads!

That cleared up some real mysteries...

Jeff