"My courses" after login without displaying "Courses" before login

"My courses" after login without displaying "Courses" before login

by Katja Leesemann -
Number of replies: 3

Hello @all!

How can I show students "their" courses ("my courses" block) after they loged in, without displaying the common "courses" block on the first site (guests who are not loged in)? I would like to hide the "courses" block but being able to guide the students to their courses (and the next pages).......

Thanks 2all

Katja

Average of ratings: -
In reply to Katja Leesemann

Re: "My courses" after login without displaying "Courses" before login

by Chardelle Busch -
Picture of Core developers
Hi Katja,

I accomplished this by adding this code:
}else if(!isguest()) {
        return $this->content;}

about line 57 after this code:
if ($this->content->items) { // make sure we don't return an empty list
                    return $this->content;
                }
        
        }

to the block_course_list.php file.  The only thing is that admins don't see all courses after login (unless they are enrolled), only course categories.

But, it does make for a nice effect when the course list block is placed under the login block, because then the My Courses block magically replaces the login block after login. 

In reply to Chardelle Busch

Re: "My courses" after login without displaying "Courses" before login

by Katja Leesemann -

Thank you Chardelle!

This is kind of what I needed, even though I didn't want the whole block "course categories" to show up at all on the first site, this works for now.

I really appreciate your help here, as well as the hints you give in the other forums. approve

Katja

In reply to Katja Leesemann

Re: "My courses" after login without displaying "Courses" before login

by Anil Sharma -
there's another way which might be more useful. check the post at http://moodle.org/mod/forum/discuss.php?d=30448 .  by changing the default login straight into a course which has a 'my courses' block, you can remove the 'courses' block from the home page