How to change the layout of the available courses section on the frontpage in gourmet theme

How to change the layout of the available courses section on the frontpage in gourmet theme

by Federick Kwok -
Number of replies: 5

Hi,

I want to change the layout of the available courses section on the frontpage. I want the courses to be displayed in a 3 columns layout instead of a list.

I've gone as far as overriding the core_course_renderer class function frontpage_available_courses() but still couldn't find the actual code that generated the HTML code for the available courses section. 

Attached is the layout I want the frontpage to look. I worked out how to hide the sidebar from the frontpage only. Its the available courses section that I'm having trouble with.

If someone could point me in the right direction as to where to find the code that generates the available courses section that would be great.

Thanks in advance.


Cheers

Federick

Attachment frontpage.jpg
Average of ratings: -
In reply to Federick Kwok

Re: How to change the layout of the available courses section on the frontpage in gourmet theme

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Gourmet is a commercially sold theme. You will need to contact the developers directly as most community members here will not have access to the code to look at for you and the free theme it was originally based on (I think it was Essential) has moved on so much with the development work Gareth and David have put into it, that looking at that will be little help to us either.

In reply to Federick Kwok

Re: How to change the layout of the available courses section on the frontpage in gourmet theme

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

It matters not what theme you are using, there is NO renderer for the course lists which are in the index.php of Moodle itself...so there is no really way to change it.

https://github.com/moodle/moodle/blob/master/index.php

In reply to Mary Evans

Re: How to change the layout of the available courses section on the frontpage in gourmet theme

by Aman Sharma -
i changed layout as you required, its matter that what theme you'r using.

smile  

Attachment Capture.PNG
In reply to Federick Kwok

Re: How to change the layout of the available courses section on the frontpage in gourmet theme

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

Hi Federick,

When you override the 'core_course_renderer' class in your theme, then the method 'frontpage_available_courses' calls the method 'coursecat_courses' and it calls 'coursecat_coursebox' to render the actual box with the course in the listing.  So look in that area as it looks like 'coursecat_courses' contains the rendering loop you are looking for.

Cheers,

Gareth

Average of ratings: Useful (1)
In reply to Gareth J Barnard

Re: How to change the layout of the available courses section on the frontpage in gourmet theme

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

Oooo...thanks for that Gareth. This is something new I have learnt!

I guess all this is from the changes in 2.5 which I never took much notice of at the time, and still wonder what all the extra coding in the layouts is about!

Cheers