sidebar in frontpage only for admin

Re: sidebar in frontpage only for admin

by edu g -
Number of replies: 1

well, I'm  a software engineer and, despite the fact that I'm learning Moodle, I have basic skills and it made sense to me. I deleted it because I did not want any block at all in the front page. I tried removing the blocks using the browser but there was no way to get rid of the Settings block.

I just want a list of courses in the front page for all my students. If the admin sees a side bar with all the blocks it won't cause any harm, though.

What should be the correct way to achieve that?

In reply to edu g

Re: sidebar in frontpage only for admin

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear edu g,

Mary is correct in saying about deleting code as that will only lead to maintainability issues - there are far better less sledge hammer solutions to this:

1. Use and set the 'My Moodle' page for users - http://docs.moodle.org/22/en/my/index - no code changes needed.

2. There is a function 'is_siteadmin()' with the $USER global - e.g. if (is_siteadmin($USER)) - I believe that it is not totally recommended and may not be supported in future, but it currently exists.  It does have a replacement but I'd have to look that up.  However, this should get you going.

Cheers,

Gareth