Creating Your Own Templates
On this page
HTML templates are stored in the templates subdirectory of the BBP installation folder. The easiest way to create a new template is to copy an existing template directory and modify its files.
Required Files#
A template directory must contain at least these three files (where {ext} is normally htm but can be any extension, including php for server-side scripts):
| File | Output name | Purpose |
|---|---|---|
index_template.{ext} |
index.{ext} |
Main index page |
fullsize_template.{ext} |
<imagename>.{ext} |
Individual image pages |
thumbnail_template.{ext} |
(stored in body token) |
Thumbnail HTML; concatenated into body |
Optional additional files: index2_template.{ext}, index3_template.{ext}; fullsize2_template.{ext}, fullsize3_template.{ext} (for frames, multi-view, or multilingual templates). Making a template file zero-length suppresses its output.
Non-template files in the template directory are copied unchanged to the HTML output folder (useful for logos, button images, backgrounds — see the icons template for an example).
User-Defined Fields (config.dat)#
Create a config.dat file in a config subdirectory of the template folder to define up to two additional user-configurable input fields (user2 and user3 tokens) in the HTML dialog.
Supported input types:
- Dropdown list (
<select>) — define options with<option>tags; usedefaultattribute to set the default. - Text entry (
<input type="text">) — free text field. - Checkbox (
<input type="checkbox" value="...">) — sets the token to the value when checked, empty string when unchecked.
Example config.dat:
<?xml version="1.0" ?>
<breezebrowser version="2.8">
<html_config>
<description>My custom template</description>
<user2 enabled="1">
<caption>Background color:</caption>
<select name="name" size="1">
<option value="#000000">black</option>
<option default>white</option>
</select>
</user2>
<user3 enabled="1">
<caption>Show EXIF data</caption>
<input type="checkbox" value="@exif@">
</user3>
</html_config>
</breezebrowser>
If user2 or user3 are defined in config.dat, the user1 field is disabled. user1 is retained only for backwards compatibility.
Line Endings#
BBP preserves the line-ending style from the template files. Use Unix-style LF endings in templates intended for Unix/PHP servers to avoid CR-LF issues.
Was this page helpful?
Thanks, that helps us improve the guides.