> For the complete documentation index, see [llms.txt](https://xoops.gitbook.io/moduleadmin-tutorial/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xoops.gitbook.io/moduleadmin-tutorial/addition-of-a-info-box.md).

# Addition of a info box

The info box is a text zone composed from a title and of a text. To create a infobox, we use `addInfoBox()`:

$variable\_name->addInfoBox($title);

$title: info box title.

To add a line in the Info box, we use addInfoBoxLine() :

```php
$variable_name->addInfoBoxLine($title, $text, $value, $color, $type);
```

* `$title` : Info box title (similar to the one used with "addInfoBox").&#x20;
* `$text` : Text to be shown in the info box.&#x20;
* `$value` : Value to appear in the text.&#x20;
* `$color` : Value color.&#x20;
* `$type` :. Values: 'default' or 'information'.&#x20;

The type 'default' uses all the parameters. It displays a text that includes the variable $value of the color 'color'.

**Example:**&#x20;

```php
$variable_name->addInfoBox("Title"); 
$variable_name->addInfoBoxLine("Title", 'Text %s and...', 'value', 'red', 'default');
```

The result:

![](/files/-LD6N2D1YifKaX5sbiT8)

The type 'information' uses only the parameters '$text'. It displays only a text.

**Example:**

```php
$variable_name->addInfoBox("Title"); 
$variable_name->addInfoBoxLine("Title", 'Text', '', '', 'information');
```

**The result:**&#x20;

![](/files/-LD6N2D3xnYE3Vacw8Dm)

To display the infos box, we use `renderInfoBox()`:

```php
$variable_name -> renderInfoBox();
```

Info boxes are automatically displayed in the pages "`index.php`" and "`about.php`" if you are using functions that handle these parts.

You can add as many lines as you want in a info box and you can put as many infos box as you wish. Those are the infos box title that can link the right lines with the correct infos box.

**Example:**&#x20;

```php
$variable_name = new ModuleAdmin(); 
$variable_name->addInfoBox("bike"); $variable_name->addInfoBox("car");
$variable_name->addInfoBoxLine("bike", 'Text1', '', '', 'information');
$variable_name->addInfoBoxLine("bike", 'Text2', '', '', 'information');
$variable_name->addInfoBoxLine("car", 'Text3', '', '', 'information'); 
echo $variable_name -> renderInfoBox();
```

**The result:**&#x20;

![](/files/-LD6N2D7UhyzEfcET-Ss)
