Create Custom Template for the Profile Page

Create Custom Template for the Profile Page

by José Roberto Júnior -
Number of replies: 1

First of all, sorry for my English. I'm not good at all.

I'm learning to create my own themes for Moodle. Using community themes as a reference, I learned to create my own templates for the main elements. However, I'm having trouble creating a template for the Profile Page.

Unfortunately, I didn't find any community theme that made its own profile page for me to use as a reference.

Can anybody help me?

I just need to know which folders and files to create in my theme and what imports I have to do.

I thank the collaboration of all.

Average of ratings: -
In reply to José Roberto Júnior

Re: Create Custom Template for the Profile Page

by Mark Sharp -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
The profile page is basically a set of links in boxes (categories), so there isn't a single mustache template to override.
There are two things you can do:
  1. Define which blocks appear on the page. Like, the dashboard page, the profile page has block regions that can be defined at the system level, so if you have a block that contains the output you need you can assign that to everyone on your site. Go to: Site administration -> Appearance -> Default profile page.
  2. Add your own navigation. You can write your own plugin, or add it to your theme, that has the function "theme_mytheme_myprofile_navigation" that returns a navigation tree.
    Do a search in the code base (search for "myprofile_navigation") for examples of other plugins that extend this function. e.g. core_badges_myprofile_navigation. This function goes in your plugin's lib.php file.