Templates

From BibleTime
Jump to: navigation, search

Themes or display templates are used in BibleTime to display the content of different works. There are two kinds of templates supported for BibleTime: regular templates and CSS templates. Note that while CSS templates only provide different display properties, regular templates can extend the functionality of BibleTime by using JavaScript.

In our repository the templates are stored in src/display-templates/. Regular templates are composed of *.tmpl files directly under src/display-templates/ and dependencies in their subdirectories. CSS templates are the *.css files directly under src/display-templates/. The Basic.tmpl file is not a separate template, but is used as a HTML base for CSS templates.

See basic_template.txt for templating CSS files.

During startup, BibleTime looks for the available templates in the system display-templates path (<prefix>/share/bibletime/display-templates).

At runtime, the following substitutions in *.tmpl files are made when using regular templates:

Search string Substitution
#TITLE# A string for <title></title>
#LANG_ABBREV# The language code for the HTML page.
#DISPLAYTYPE# A string describing where the template is used, can be one of:
  • bible
  • book
  • singleentry
  • infodisplay
  • printer
#MODTYPE# Same as #DISPLAYTYPE#
#LANG_CSS# Language-specific inline CSS rules for font etc.
#PAGE_DIRECTION# "ltr" or "rtl" for left-to-right and right-to-left respectively.
#CONTENT# The content to display
#MODNAME# The name of the first work, or empty
#DISPLAY_TEMPLATES_PATH# The absolute filesystem path to the display-templates directory, which can be used to include other files in the template.
Personal tools