Hamburger Theme Selector

Are you on latest, are the themes user selectable?

There is a checkbox saying ā€œTheme can be selected by usersā€. So I assume yes.

Thanks for the quick answer.

so any thoughts, Sam? :slight_smile:

Can you confirm that you have done this?

The way I understand it is youā€™re going to need the hamburger theme selector added as a Theme Component for all of your other existing themes for it to appear. Add the hamburger theme to all of the others via the Theme includes other child themes option.

10 Likes

this is such a useful extension. Please consider including this as a part of Discourseā€™ core.

4 Likes

Related:

4 Likes

Just an FYI for everyone ā€¦ recent 2.1 Beta update broke the existing Hamburger Theme Selector installations. It simply took an update of the HTS to fix this from within its Theme component admin. (so seems someone knew about this, aha! :wink: (@Sam would have been good to have a heads up, sorry if I missed it) ) (there seems however to be a new issue with Themes admin, see my ā€˜bugā€™ report)

9 Likes

Just a minor suggestion - it might be worth adding a ā€˜Themesā€™ header to that section of the menu to help users figure out what those are. Where Iā€™ve added the red box -

16ada34132c54804afa4a728b711bda1bffe8c25

4 Likes

The theme-selector seems to be broken in v2.2.0.beta4 +266.

TypeError: e.reject is not a function
    at Object.a [as setLocalTheme] (_application-0886f4c5dbc868ca081df73f2ba68777febbad4e17b4e00dc8cb7aa447d11a4d.js:21312)
    at 0c56ef81d321af57aa11e5f7762b891635ccf8ce.js?__ws=www.elektronauts.com:16
    at A (_ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js:57655)
    at S (_ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js:57670)
    at C (_ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js:57638)
    at invokeWithOnError (_ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js:12552)
    at a.flush (_ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js:12613)
    at u.flush (_ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js:12737)
    at p.end (_ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js:12807)
    at p.run (_ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js:12921)

happens in

themeSelector.setLocalTheme(key, r.user.user_option.theme_key_seq);

Any ideas?

/David

It works ok for me - Iā€™m using it right now on this site!

Can you reproduce the problem here? If so, what browser are you using?

3 Likes

Guys, this seems broken at the moment?

I updated to latest of both theme component and main build (tests passed) but getting a javascript error:

Uncaught TypeError: Cannot read property 'immediate_reload' of undefined

At the same time there seems to have been introduced some slick new code for switching Themes on meta that avoids a page refresh.

Is this because the release of this change is out of sync (for some branches) with the update to the Hamburger Theme Selector?

Any idea when the change on meta will be promoted to tests-passed?

1 Like

Meta is running tests-passed (well tests-passed, with a little Ember 3.7 magic on top, but that shouldnā€™t affect this).

Do you see the ā€œimmediate reloadā€ setting in the admin panel, at the bottom of the options for this theme component? It should look like this:

4 Likes

Thanks for comfirmation. I see now this feature is already there.

Yes, it is there and checked.

If I uncheck it, the javascript error goes away (and the theme instantly updates without a page reload).

1 Like

Any chance you can share the link for the site? I enabled the setting on Meta, and it still seems to be working ok

Thanks for your interest, David, PMā€™d.

btw, love this new feature! :slight_smile:

It looks like toggling the setting off/on has fixed the problem. There must be a caching issue somewhere, which Iā€™ll try and track down.

6 Likes

For reference, this was fixed today by @Osama :smiley:

cc @merefield

9 Likes

Is it possible to have an actual switch, built with CSS and embedded into the top bar, to switch themes from [A] to [B]?

https://www.w3schools.com/howto/howto_css_switch.asp

Like this. If so, what would be the command required, as it isnā€™t just a simple link? Perhaps it could utilize the Hamburger Theme Selector in some way?

Did you already see Alien Night Theme - A free Dark Theme for Discourse ?

2 Likes

PERFECT, thanks Daniela.