# The stylesheets inclusion mechanism

If you ever want to include more stylesheets to the list, this is the complete flow :

* a script starts (e.g. /user\_portal.php)
* it includes global.inc.php
* global.inc.php calls the method Display::display\_header() (in main/inc/lib/display.lib.php)
* display\_header calls the Template ::set\_css\_files() methos
* set*css\_files() prepares an array with the CSS to load and prepares it as \_css\_file\_to\_string*
* the initial script loads a template (.tpl) from main/template/default/
* the template includes the main/template/default/layout/main\_header.tpl template
* the main\_header.tpl load head.tpl (in the same folder)
* head.tpl loads the *css\_file\_to\_string* array to show the CSS in the

If you want to configure a new stylesheet globally, or change the order in which they are loaded, and if you followed the previous flow, you'll now know that the best place to do so is int the Template::setCssFiles() method.

This is the best method so far in Chamilo 1.10, but in 2.0 with the full capability of templates unleashed, you should be able to add directly the new CSS to your template.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.chamilo.org/1.11.x/developer-guide/theming_through_css/the_stylesheets_inclusion_mechanism.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
