Edit this topic

Default theme selector

: shell

: theme-selector

: default-theme-selector

: /modules/core/ui/services/default-theme-selector.js

: https://github.com/DecentCMS/DecentCMS/blob/master/modules/core/ui/services/default-theme-selector.js

class: DefaultThemeSelector

new DefaultThemeSelector(scope)

The default theme selector picks the theme that is configured in site settings.

An example of site settings that picks the default theme is:

"default-theme-selector": { "theme": "decent-theme-default" }

The name specified in the settings must be the technical name of the theme as specified in the theme's manifest (package.json file at the root of the theme.

Param Type Description
scope object The scope.

defaultThemeSelector.isThemeActive(moduleManifest) ⇒ boolean

Looks at a theme's manifest and determines whether it should be active for the current request, by comparing its name with the one configured in site settings.

Returns: boolean - True if the theme should be active.

Param Type Description
moduleManifest object The module's manifest.