Theming through templates
Chamilo, since version 1.10, uses the Twig templating engine for most (and in the future all) of its interface.
To update the template in Chamilo, you can one of two things: redefine some template files in
main/template/override/OR copy the
defaultfolder and modify a line in
app/config/configuration.php, following this procedure :
cp -r default newtemplate
// edit the new template to your heart's contempt
// Find the $_configuration['default_template'] setting and replace
// 'default' by 'newtemplate', then uncomment it (remove the // prefix)
// Finally, refresh the archives (find the « Archive cleanup » option on
// the admin page
This way, you can edit anything in your new template, while keeping the original template available, and you also avoid your template being overwritten during your next Chamilo upgrade.
However, it is important to understand that any custom template will have to be maintained: if a new .tpl file is created in the default/ template in Chamilo, then this new .tpl file will have to be added to your custom template. In the case of the override/ folder, although it is not necessary to create the corresponding file, it is still necessary to make sure that no new information added to the default/ .tpl file that would otherwise not appear in the override. These changes can be tracked through the history of changes in the default/ directory on Github: https://github.com/chamilo/chamilo-lms/commits/1.11.x/main/template/default
Inside the default directory, you'll find the following directories, which we explain when needed (most of them are self-explanatory).
- auth → all stuff related to authentication forms and processes
- index → homepage for anonymous users and announcements
- layout → header, footer, banner and more are stored here
- userportal → list courses in « My courses » tab