Spica Posted March 28, 2018 Share Posted March 28, 2018 $config->defaultAdminTheme = 'AdminThemeUikit'; Set this iton the site/config.php. But has no effect. Well, I would expect to have all users with default theme selected to be switched to the uikittheme. Am I taking it wrong? Link to comment Share on other sites More sharing options...
LostKobrakai Posted March 28, 2018 Share Posted March 28, 2018 The default is the theme used if users do not have a admin theme saved in the db (mostly new users afaik). Link to comment Share on other sites More sharing options...
Spica Posted March 28, 2018 Author Share Posted March 28, 2018 Ah, ok. Missunderstood. Any way to change it by configuration in the way I would like it – to set the uikittheme as the default/standard theme for all users? Link to comment Share on other sites More sharing options...
monchu Posted March 29, 2018 Share Posted March 29, 2018 You have to activate first the AdminThemeUIkit from your module page Link to comment Share on other sites More sharing options...
Spica Posted March 29, 2018 Author Share Posted March 29, 2018 3 hours ago, monchu said: You have to activate first the AdminThemeUIkit from your module page Of course it is already activated. What I want is to switch the default theme to uikit for all existing users who have choosen the default theme. I cannot find eg any point to hook to. Link to comment Share on other sites More sharing options...
bernhard Posted March 29, 2018 Share Posted March 29, 2018 pseudocode: // tracy console foreach($users as $user) { if(user admin theme == ..) $user->setAndSave('admin theme', 'uikit'); } you'd need to find out the correct properties and values, but that should not be too hard. 2 Link to comment Share on other sites More sharing options...
Spica Posted March 29, 2018 Author Share Posted March 29, 2018 37 minutes ago, bernhard said: you'd need to find out the correct properties and values, but that should not be too hard. // tracy console foreach($users as $user) { if($user->admin_theme == 'AdminThemeDefault' || $user->admin_theme == '') $user->setAndSave('admin_theme', 'AdminThemeUikit'); echo $user->name . ": " .$user->admin_theme . "<br>"; } Well. This did it. It not exactly what I would have prefered but it works. Now every user has the uikit theme marked in his profile. What was confusing: New Users have the default admin theme marked in the interface by default, but have no entry in the db ($user->admin_theme == ""). But explicitly saving the users profile will entry the AdminThemeDefault. 1 Link to comment Share on other sites More sharing options...
bernhard Posted March 29, 2018 Share Posted March 29, 2018 1 hour ago, Spica said: What was confusing: New Users have the default admin theme marked in the interface by default, but have no entry in the db ($user->admin_theme == ""). But explicitly saving the users profile will entry the AdminThemeDefault. https://github.com/processwire/processwire-issues/issues/514 2 Link to comment Share on other sites More sharing options...
Spica Posted March 29, 2018 Author Share Posted March 29, 2018 1 hour ago, bernhard said: https://github.com/processwire/processwire-issues/issues/514 And https://github.com/processwire/processwire-issues/issues/523 Yes. That explains... 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now