# Templates

You can use txt files to describe the logout message a player will see when he gets banned.\
By default this entire functionality is disabled. To enable templates do the following.

### Setup

Inside the Staff++ plugin directory create a **bans** directory if it does not already exists.\
\
Inside this bans directory you can create the template files. A template file is a simple text file containing the message that will displayed to the user on ban. Example file:

{% file src="<https://3621425798-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MPQohtcLxhXAvpSXOMt%2F-MW6nYvC-H1guOuMOZiY%2F-MW6p7-bk759j2hyKOEZ%2Fdefault.txt?alt=media&token=758fe086-e5e4-4009-acde-1e55a2ecae98>" %}
bans/default.txt
{% endfile %}

I named the above file **default.txt.** The file name without extension will be used as **template name**.<br>

This will result in the following:

![](https://3621425798-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MPQohtcLxhXAvpSXOMt%2F-MW6nYvC-H1guOuMOZiY%2F-MW6q6iGCsvw71M8Nu1u%2Fban_template.png?alt=media\&token=fc2dc5c2-059e-484d-a021-aff22685850a)

My example is not that pretty but it illustrates the usage.<br>

#### placeholders

Inside the template the following placeholders can be used

| placeholder | description                                           |
| ----------- | ----------------------------------------------------- |
| %target%    | The banned player's username                          |
| %issuer%    | The staff members username                            |
| %reason%    | The ban reason                                        |
| %duration%  | Human readable duration. Only available with tempbans |

### Configuration

```yaml
ban-module:
  enabled: true
  permban-template: default
  tempban-template: default
```

Inside the **config.yml** file you can fill in a default template for permanent and temporary ban. Or leave it empty to fall back on the message defined in the lang file.

### Overwriting the default template

If staff members have the permission: `staff.bans.ban-template-overwrite` they can use an extra parameter **"-template="** when banning a player.\
Example:\
`/ban thisplayer -template=other I ban you!`

This will overwrite the default configured template and try to find and use a template with the given name. If the template does not exist an error will be shown.
