griffith-export-template5
Export using templates
Usage
Export Using Templates - A Griffith's export plugin making use of fully customizable templates
Overview
Creating a new template:
Make a new directory with the short name 'template/template' family (each dir can contain more then one template, see config.xml description)
Prepare page.tpl file. Page.tpl file should contain three parts:
* header - will appear on top of every generated file
* items - will be filled with data from every exported movie
* tail - will appear at the bottom of files
To split them, add <!-- ITEMS --> string before and <!-- /ITEMS --> string after items part.
Make config.xml file (see CONFIG section)
Optionaly: make preview images (see CONFIG file section). Best resolution for preview images is 200x150px
Template tags
Bellow are listed the allowed tags in page.tpl files. Every tag name starts with "@" character. Between tags you can put two special strings: @TITLE@ and @DATA@ wich will be replaced with fields (translated if needed) title and movie data.
Example: <@runtime>@TITLE@ field contains "@DATA@" data</@runtime> will be transformed into: Runtime field contains "120 min." data
List of allowed tags:
Tags allowed everywhere:
|
string defined in "Template" tab, @TITLE@ not used |
|---|---|
|
generates navigation bar (if required) |
|
prints document's copyright |
Tags allowed only in "items" part:
image-
name of the poster image file (without path and extension)
number-
movie's ID in database
title-
movie's title
original_title-
movie's original title
year-
movie's premiere
director-
movie's director
rating-
number (0-9)
runtime-
movie's runtime in minutes
country-
name of country, where movie was produced
genre-
movies's genre
imdb-
from this URL was fetched movie's data
site-
official site's URL
trailer-
URL where movie's trailer can be found
media-
number of discs and disc type, f.e. "2xDVD"
seen-
"Yes" or "No"
loaned-
"Yes" or "No"
classification-
movie's classification
studio
actors-
movie's coast
plot-
movie's summary
Config file
The easiest way to create config.xml file is copying it from another template and just editing it. Every file must contain template's author, version and author's email. Optionally you can add description and list of styles. Every style item must contain name and file name. See template.dtd for more details.
Examples
Example template can be found at /usr/share/griffith/export_templates/html_tables dir