Bureaucrats, emailconfirmed, Administrators
149
edits
Rdoursenaud (talk | contribs) m (Sync with french) |
Rdoursenaud (talk | contribs) (Tried to clarify some terms) |
||
| Line 2: | Line 2: | ||
{{TemplateDocDevEn}} | {{TemplateDocDevEn}} | ||
A box is a rectangular area that can be displayed on some pages ( | A box is a rectangular area that can be displayed on some pages (only the home page for moment). These are described by files in a specific directory. | ||
Boxes content is left to the developer's imagination (graphics, text, tables, …). | Boxes content is left to the developer's imagination (graphics, text, tables, …) but a basic framework allows for easy table based presentation. | ||
= [[File:art.png]] Create a new box = | |||
Every standard box is stored inside the '''htdocs/core/boxes''' directory. | |||
There is one file for each box. | There is one file for each box. | ||
Each file is a class inherited from the '''ModeleBoxes''' class. | Each file is a class inherited from the '''ModeleBoxes''' class. | ||
To create a new box, copy an existing box file | To create a new box, you may copy an existing box file, rename it, for example to '''box_myownbox.php''' and change its content to match the new name. | ||
You can now define the informations you want to show inside the box. | |||
However if you plan distributing your box to other users, you | However if you plan distributing your box to other users, you must create a module and store your box files inside your module. | ||
* Go to [[Module development]] page to learn how to create a module | * Go to [[Module development]] page to learn how to create a module | ||
* | * Create your box file into '''htdocs/mymodule/core/boxes/''' | ||
* Once your module descriptor is created, add these lines to declare your box file | * Once your module descriptor is created, add these lines to declare your box file | ||
<source lang="php"> | <source lang="php"> | ||
| Line 35: | Line 35: | ||
= [[File:art.png]] Activate a box = | = [[File:art.png]] Activate a box = | ||
To activate a box, go to '''Home - Setup - Boxes''' page and click activate on the box you want to see. It will be displayed on the page for which you have activated the box. | |||
To activate a box, go to '''Home - Setup - Boxes''' page and click activate on the box you want to see. | |||
It will be displayed on the page for which you have activated the box. | |||