Students Selecting themes

Students Selecting themes

by William Mair -
Number of replies: 4

Hi,

I might just be being dumb here, but if I tick the box in the Theme Settings for allowuserthemes, where in the students login can the see the list of themes to select from?

Basically, I want to make different copies of a theme with different colour combinations (for accessbility use) and want them to be able to select which theme to use.

I'd prefer to be able to add this to my menu bar at the top too if anyone knows how to do that.

Thanks in advance.

Average of ratings: -
In reply to William Mair

Re: Students Selecting themes

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

They can choose in their profile.

In reply to Mary Cooch

Re: Students Selecting themes

by William Mair -

Mary,

I'd guessed it would be in around there, but didn't look in the edit profile bit.

Thanks

In reply to William Mair

Re: Students Selecting themes

by Sam Hemelryk -
Hi William,

In regards to adding a theme selector to the menu bar at the top of your theme there is a quite work around you may like to explore.
If you enable allowthemechangeonurl you will be able to construct links in your menu bar that change the theme.
All you need to do is add `''?theme=whatever''` or `''&theme=whatever''` to the end of your URL.
If you are doing it through the custom menu you will need to construct a permanent URL, it will work fine but of course your users will be redirected back away from where ever they are.
Alternatively if you have your own theme and have your own top menu then I'd recommend the following code:

echo html_writer::link(new moodle_url($PAGE->url, array('theme' => 'whatever')), 'The whatever theme');

This will produce a link that will change the theme, and in most cases take the user back to the page they were viewing.

Hope that helps.

Cheers
Sam
Average of ratings: Useful (1)
In reply to Sam Hemelryk

Re: Students Selecting themes

by William Mair -

Sam,

Thanks for getting back to me. My intention had been to put it in the custom menu, but had come across the same thought regarding the URL and not refreshing the current page.

I've just created duplicate themes with differing colours for different accessibility needs and made all available to students in their profile.

Seems the easiest way overall, although the menu would have been easiest for students.

Thanks