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

von Federick Kwok -
Anzahl Antworten: 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

Anhang frontpage.jpg
Als Antwort auf Federick Kwok

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

von Richard Oelmann -
Nutzerbild von Core developers Nutzerbild von Particularly helpful Moodlers Nutzerbild von Plugin developers Nutzerbild von 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.

Als Antwort auf Federick Kwok

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

von Mary Evans -
Nutzerbild von Core developers Nutzerbild von Documentation writers Nutzerbild von Peer reviewers Nutzerbild von Plugin developers Nutzerbild von 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

Als Antwort auf Mary Evans

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

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

lächelnd  

Anhang Capture.PNG
Als Antwort auf Federick Kwok

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

von Gareth J Barnard -
Nutzerbild von Core developers Nutzerbild von Particularly helpful Moodlers Nutzerbild von 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

Als Antwort auf Gareth J Barnard

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

von Mary Evans -
Nutzerbild von Core developers Nutzerbild von Documentation writers Nutzerbild von Peer reviewers Nutzerbild von Plugin developers Nutzerbild von 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