General developer forum

Remove "Miscellaneous", "Reports" and "Login activity" sections from User profile.

 
Picture of Aditya Dubay
Remove "Miscellaneous", "Reports" and "Login activity" sections from User profile.
 

Hi,

 

I am using Moodle 3.1

I am using Elegance Theme.

I wish to know that how to remove "Miscellaneous", "Reports" and "Login activity" sections from User profile.

 

Thanks in advance.

 
Average of ratings: -
It's only an avatar...
Re: Remove "Miscellaneous", "Reports" and "Login activity" sections from User profile.
Group Core developersGroup Documentation writersGroup Particularly helpful MoodlersGroup Plugin developersGroup Testers

Hi

This is nothing to do with themes, as this is more of an Administration problem.

If there is a way of governing what is displayed on a users profile then this will be in the Administration section of Moodle.

The easiest way to find out is to do a search in the Moodle Docs.

Mary

 
Average of ratings: -
Picture of Salman Zaidi
Re: Remove "Miscellaneous", "Reports" and "Login activity" sections from User profile.
 
I know this is a bad hack but is only solution. I think Moodle does not provide the profile page block management from administration.

You can do by this way:

In user/classes/output/myprofile/renderer.php in render_tree(tree $tree) fucntion

A
dd an if condition as shown in next code block.


Original:

foreach ($categories as $category) {
                $return .= $this->render($category);
        }


Tailored:

foreach ($categories as $category) {
            if ($category->name !== 'miscellaneous' && $category->name !== 'coursedetails' && $category->name !== 'reports') {
                $return .= $this->render($category);
            }
        }


Note: If you want to hid more blocks you can find out the exact string by outputting

echo $category->name."   ";

And you can put those block name in condition above.

 
Average of ratings: -