Moodle 26/7 defining theme by a value in Moodle

Moodle 26/7 defining theme by a value in Moodle

by Todd Askens -
Number of replies: 2

Hi,

I want to change the theme displayed on login to be specified for a user.

I know that a custom menu can be different depending on the language used for the site. So I'm thinking that it's possible to apply this principal to other values on the site eg a value in a user profile field and also to wider theme characteristics.

So user Mary has abc in a user profile field and sees the site with Theme A

User Jonny has xyz in a user profile field and sees the site with Theme X

Alternatively this could be a single theme and trigger different stylesheets within it.

So I have a big idea but I don't know where to look to start this off. Where, for example, is the code that affects the custom menu change depending on language?

Oh and user themes are no good because users can change them.

Has anyone achieved the specific theme per user effect in another way that doesn't need coding?

Average of ratings: -
In reply to Todd Askens

Re: Moodle 26/7 defining theme by a value in Moodle

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi Todd,

There is already a field called 'theme' in the user table in the Moodle database.

So if Admin assigns a theme to a student then that theme will be used every time that student is loggedin

In reply to Mary Evans

Re: Moodle 26/7 defining theme by a value in Moodle

by Todd Askens -

That didn't work for me. I entered Afterburner in the theme field and logged in as that user and the theme was still the default for the site. No change when I enabled user themes. Does it work for you? I don't want user themes enabled because users can change the theme.

If I could find how the theme custom menu picks up the language value and changes the items based on the language under use that might help me. Any ideas on that?