Students Selecting themes

Students Selecting themes

על ידי William Mair בתאריך
מספר תגובות: 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.

ממוצע דרוגים: -
בתגובה ל: William Mair

Re: Students Selecting themes

על ידי Mary Cooch בתאריך
תמונה של Documentation writers תמונה של Moodle HQ תמונה של Particularly helpful Moodlers תמונה של Testers תמונה של Translators

They can choose in their profile.

בתגובה ל: William Mair

Re: Students Selecting themes

על ידי 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
בתגובה ל: Sam Hemelryk

Re: Students Selecting themes

על ידי 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