Skip to main content

Custom Moodle Format to Display Class Title and Summary

Question:

How can we display course information such as the title and summary without entering the information by hand? We are able to have this information automatically entered in the class settings, but also want it to appear in the topic view of the course.

Answer:

In order to solvedisplay twothe existingtitle Moodleand problemssummary (1of ,the 2),course in the course view, a new format.php should be developed. This has the benefit of providing exactly what is needed, however the downside is that it is UCLA specific.

To simplify the process this will be mainly based of the topics format (/course/format/topics/format.php). The lines that are of importance are 96-116.

To solve the summary display issue:

  • replace echo format_text($thissection→thissection->summary, FORMAT_HTML, $summaryformatoptions);
  • with something similar to line 29 of block_course_summary/blocks/course_summary/block_course_summary.php : “format_text($COURSECOURSE->summary, FORMAT_HTML, $options);

To solve the Topic Outline header:

  • replace line 81 of topics format/course/format/topics/format.php with something that prints the course name.