Hide for students a moodle block with css

Re: Hide for students a moodle block with css

by Mark Sharp -
Number of replies: 1
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Depending on the block you may not need to resort to CSS. You can hide things with capabilities. Also note that "students" only exist in a course context, so if you're talking about students on the Home page, or on the dashboard, there's no simple way of detecting them.
Average of ratings: Useful (1)
In reply to Mark Sharp

Re: Hide for students a moodle block with css

by Kurt Armbruster -
Hi @Mark

I'm working with a team that has a similar question. We have a block on the main dashboard that takes a student to specific module in a course (first incomplete module, course home page, etc), and we want to hide the block in the main dashboard if a user isn't registered in the course.

In case the issue is different, I've started a specific thread for our issue in the Moodle discussion forum here: https://moodle.org/mod/forum/discuss.php?d=431236

I'd welcome any elucidation on why the main dashboard can't hide blocks based on the enrolment of a student in a specific course.