Change the layout of course list

Change the layout of course list

by Helson C -
Number of replies: 4

First of all, sorry for my bad english.

I need to change the look of course page without changing codes of moodle.

I need the courses side by side, like a grid. 

Create a theme would be feasible? Or create a plugin would be enough?

Thanks.

Average of ratings: -
In reply to Helson C

Re: Change the layout of course list

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Helson,

To get you started, you need to override the core course renderer in a theme.  Start with: https://docs.moodle.org/dev/Overriding_a_renderer then look at: https://github.com/DBezemer/moodle-theme_essential/blob/master/renderers/core_course_renderer.php which is loaded by: https://github.com/DBezemer/moodle-theme_essential/blob/master/renderers.php as referenced in the Moodle documentation.

Gareth

In reply to Gareth J Barnard

Re: Change the layout of course list

by Helson C -

Thanks for your reply.

I will try and come back to answer.

In reply to Helson C

Re: Change the layout of course list

by Helson C -

Hi Gareth, see the result.

Course list side by side


For this, i create a "theme" with a renderer that extends of core_course_renderer and override the method coursecat_coursebox and add a css file who override style of .coursebox.

Is this the best way?

How i can add multiples renderers? Is it possible? 


Thank you so much!

In reply to Helson C

Re: Change the layout of course list

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Helson,

RE: Is that the best way? I think so, but I've not actually solved your problem in code to determine if it was.  I'm only guessing from experience that its the right place to start.

RE: How i can add multiples renderers? Is it possible?  - Umm, the same renderer or different ones?  What possible solution are you thinking of that requires them?  Please can you explain more.

Gareth