Course Categories Block Missing?

Course Categories Block Missing?

بواسطة - Robert Wagenhoffer
عدد الردود: 4
Hello,

I presently operate four Moodle instance that have been operational for sometime.  In general, these instance are configured identically but are set up for individual clients.  When I set these up, I added a block called "Course Categories" on the home screen.  This block shows links to the various courses categories I created.  Recently, I set up a new Moodle instance from scratch and can not find this block for nothing?  All instances are Moodle 4.3.3.  Does anyone know what happened or what I am doing wrong?  For the life of me, I have no idea how I originally added this block. 

Thank you in advance.Course Categories Block
متوسط التقييمات: -
رداً على Robert Wagenhoffer

Re: Course Categories Block Missing?

بواسطة - Mary Cooch
صورة Documentation writers صورة Moodle HQ صورة Particularly helpful Moodlers صورة Testers صورة Translators
The block's name is course_list and if you are using Boost you need to remove it from the Unneeded blocks list in Site administration > Appearance > Themes > Boost. Then you will be able to choose it from the block drawer where it displays as 'Courses'. And incidentally, it only shows as Course categories to you the admin and to anyone who is not yet enrolled in any courses.Once enrolled in courses, the block becomes My courses and shows just enrolled courses.
رداً على Mary Cooch

Ynt: Re: Course Categories Block Missing?

بواسطة - Çağrı Akkaya

Hi Mary,

My current Moodle version is 4.3.6 and my previous version was 4.3. Before the update it always showed my courselist categories but now it doesn't. I want to see the categories even if the students are enrolled in the course. I removed the unnecessary blocks from the list in the boost theme but it didn't change. I am using lambda theme. Your support is very valuable.

رداً على Çağrı Akkaya

Ynt: Re: Course Categories Block Missing?

بواسطة - Çağrı Akkaya
I solved the problem myself using codes. I am writing the steps below.

Open the "block_course_list.php" file under the .../blocks/course_list directory and delete the code below or place it between /* */.

if (empty($CFG->disablemycourses) and isloggedin() and !isguestuser() and
!(has_capability('moodle/course:update', context_system::instance()) and $adminseesall)) { // Just print My Courses
if ($courses = enrol_get_my_courses()) {
foreach ($courses as $course) {
$coursecontext = context_course::instance($course->id);
$linkcss = $course->visible ? "" : " class=\"dimmed\" ";
$this->content->items[]="shortname, true, array('context' => $coursecontext)) . "\" ".
"href=\"$CFG->wwwroot/course/view.php?id=$course->id\">".$icon.format_string(get_course_display_name_for_list($course)). "
";
}
$this->title = get_string('mycourses');
/// If we can update any course of the view all isn't hidden, show the view all courses link
if ($allcourselink) {
$this->content->footer = "wwwroot/course/index.php\">".get_string("fulllistofcourses")." ...";
}
}
$this->get_remote_courses();
if ($this->content->items) { // make sure we don't return an empty list
return $this->content;
}
}