Updated Templates (markdown)

El RIDO 2016-08-23 12:08:34 +02:00
parent 084b20c96b
commit 2b3f8228cb

@ -2,15 +2,17 @@ PrivateBin comes with multiple templates and of course you can also create your
## Creating templates
For beginners it is suggested to copy `tpl/bootstrap.html` and adapt it to your design. You can put the HTML of your template into the directory `tpl`, i.e. `tpl/myawesometemplate.html`.
For beginners it is suggested to copy `tpl/bootstrap.php` and adapt it to your design. You can put the HTML of your template into a PHP file in the directory `tpl`, i.e. `tpl/myawesometemplate.php`.
If you don't reuse external resources (CSS, images, etc.) in your PrivateBin template, we suggest to put CSS and fonts into a subfolder at `css/myawesometemplate`, images into a subfolder at `img/myawesometemplate` and javascript libraries into the folder `js` (if these are publicly available libraries, it is suggested to include the version number in the file name, to ensure they are reloaded in your visitors browser when you upgrade them).
If you don't reuse existing external resources (CSS, images, etc.) in your PrivateBin template, we suggest to put CSS and fonts into a subfolder at `css/myawesometemplate`, images into a subfolder at `img/myawesometemplate` and javascript libraries into the folder `js` (if these are publicly available libraries, it is suggested to include the version number in the file name, to ensure they are reloaded in your visitors browser when you upgrade them).
PrivateBin uses the [RainTPL template engine](http://rainphp.github.io/raintpl/), you can read about its possibilities on their [documentation for webdesigners](https://github.com/rainphp/raintpl3/wiki/Documentation-for-web-designers).
PrivateBin uses straightforward PHP scripts, that are included into the PrivateBin\View class. Only variables that are set in that class can be accessed as local variables in the templates PHP script, otherwise you can of course use any PHP code supported by your server. Keep in mind that you need to escape variables properly before writing them to output. As suggested it is best to use one of the existing template files and simply replace the HTML parts in it.
If you designed an awesome template, please consider sharing it with the project to add it to the templates we ship with the next release.
## Configuring templates
To enable the use of a template, configure its name (without the `.html` ending) in the [template property](https://github.com/PrivateBin/PrivateBin/wiki/Configuration#template) in the configuration file at `cfg/conf.ini`.
To enable the use of a template, configure its name (without the `.php` ending) in the [template property](https://github.com/PrivateBin/PrivateBin/wiki/Configuration#template) in the configuration file at `cfg/conf.ini`.
## Templates included in PrivateBin