General developer forum

Change the user profile page

 
Picture of Amy Stewart
Change the user profile page
 

I would like to add some custom information to /user/profile.php.  I was hoping to do this through a theme renderer, but notice that the code that creates that content is part of myprofilelib.php (core_myprofile_navigation) .  Is there a way to override or extend this function in order to add another category and content within that category?


Thanks!

 
Average of ratings: -
Picture of Amy Stewart
Re: Change the user profile page
 

I figured out how to do it with a report plugin with the <plugin_name>_myprofile_navigation function.  I'd still like to customize this to include some custom jquery code and stylesheets.  I'm working on it.

 
Average of ratings: -
Picture of Michael Milette
Re: Change the user profile page
Core developersParticularly helpful MoodlersPlugin developers

Hi Amy,

You don't need to customize any core Moodle code... or even your theme. Moodle has all the functionality you need built right in!

First start by going to:

Site Administration > Users > Accounts > User profile fields

This is where you create new sections and fields for the profile page.

If you want to add a new field, select the type from the "Create a new profile field" dropdown list.

New fields will be added to the "Other fields" section of the profile page by default. If you want to create a new section on the profile page, click the "Create a new profile category" page.

If you need to re-order the fields beyond the options available, you will need to add JavaScript. This can either be done in your theme, if you are using a custom theme, or on the HTML settings page which you can access by going to:

Site Administration > Appearance > Additional HTML

You can add STYLE and SCRIPT tags on this page. They will be inserted into your page header or body depending in which field you use.

Hope this helps.

Best regards,

Michael Milette


 
Average of ratings: -