# General workflow of plugins

The (shortened) plugins workflow as follow:

* you create the plugin.php file and the index.php
* you then configure where it will be seen (in the plugins section of the administration panel)
* the main/inc/lib/template.lib.php class (around line 140) "loads" the plugins regions
* regions are defined in main/inc/lib/plugin.lib.php and the method "get\_installed\_plugins\_by\_region" allows you to know which plugin should be enabled in a specific region of the user interface
* (back to template.lib.php \~140) the template lib "loads" the plugins inside specific template variables called "plugin\_\[region]"
* the template variables defined are then shown by any .tpl that loads them

  TPL (template) files inside the main/template/default/ directory (see templates section above).

  For example, for the normal student "2-columns" view of the courses list (like in user*portal.php), you can check layout/layout\_2col.tpl, and in general they will load {{plugin*\[region]}}variables depending on the region the plugin defines.At the moment, there is no "region" defined for the courses list, so if you want to make a plugin appear there, you should define a new region (both inside one of the .tpl files and inside plugin.lib.php), or you could use the menu\_top and menu\_bottom respectively (I believe these are for the left/right menu).


---

# 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/plugins/general_workflow_of_plugins.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.
