General developer forum

Show teacher names in courses

 
Picture of Nguyen Khanh Luong
Show teacher names in courses
 

I want to display all teacher names under course name in the Course Overview.

Can anyone tell me which files I have to edit? I already have some PHP knowledge.

Thanks in advance


 
Average of ratings: -
Picture of Deepak Gour
Re: Show teacher names in courses
 

Hi Luong

If you want to display teacher name under course name,

share a link it might help you.   

https://stackoverflow.com/questions/35124469/how-to-display-trainer-name-after-course-name-in-my-courses-section-of-moodle


 
Average of ratings: -
Mary Cooch
Re: Show teacher names in courses
Documentation writersMoodle Course Creator Certificate holdersMoodle HQParticularly helpful MoodlersTestersTranslators

Deepak's link refers to an out of date Moodle version and a different course overview block, so I'm not sure whether it will work or not. (I am not a programmer.) I don't think you can get the teacher's name to appear in the new Course overview block by default, as you have  seen, but hopefully someone can suggest a coding option if you really need it.

 
Average of ratings: -
Picture of Rahul Rai
Re: Show teacher names in courses
 

Hello Luong

You don't need to modify any code.

Simple Go to Site Administration > Development > Purge-all-caches.  

And click on "Purge all caches"

Then check teacher name.  


 
Average of ratings: -
Mary Cooch
Re: Show teacher names in courses
Documentation writersMoodle Course Creator Certificate holdersMoodle HQParticularly helpful MoodlersTestersTranslators

Purge caches to display the teacher name will work for the site front page but the new Course overview block does not display names by default, so this will not apply here.

 
Average of ratings: -
Picture of Chris Kenniburg
Re: Show teacher names in courses
Particularly helpful MoodlersPlugin developers

While not exactly what you want to do, Richard Oelmann initially did some work for his theme Handlebar in which it would display teachers and contact details in a special modal window for students.  

I also utilized this method for the Fordson theme and when students go to a course they can see the teacher as well as a method to contact them (email/message).

https://github.com/dbnschools/moodle-theme_fordson/blob/master/classes/output/core_renderer.php#L770-L808


The code in my link might help you gather all the information from the database for the teacher of the course and then you would need to hack the core course overview block or create your own based off that one.

Or you could decide to just include the teacher contact information on the actual course page such as what is done with Handlebar and Fordson themes.

Hope that helps get you started.

Chris

 
Average of ratings: -