Author Topic: Creating templates for export plugin  (Read 32040 times)

0 Members and 2 Guests are viewing this topic.

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Creating templates for export plugin
« on: December 05, 2007, 05:15:18 am »
Information in this topic is outdated. Please refer to this document for most current state of the export plug-in: http://www.videodb.info/help/hlp_export.html

Templates are file with .ptm extension. Main template files must be saved in Plugins\Templates directory, subtemplates can be saved anywhere.

Options

Template options have to be at the top of the main template file between %OPTIONS% tag.

Following options are available:
replace="value1<->value2"Replaces value1 with value2 in all variables. You can set value1 or value2 to a line break using #13#10
filter="value"File filter used in "Save as" dialog. Ex.: HTML Files|*.html;*.htm
encoding="value"Text encoding. This parameter can be the following value:
  • ANSI - Save as ANSI text (using Windows default code page)
  • UTF8 - Save as UTF8
sortby="value"Number of the field that should be used for sorting.
sortdir="value"Sorting direction.
  • sdAscending - Sort Ascending
  • sdDescending - Sort Descending
imagepath="value"Where images are to be saved. This path should be relative to the resulting text file.
recordtemplate="значение"Path to a template for generating a file for each record relative to main template file.
recordfilename=[name]%d.[extension]How to name files generated using recordtemplate. %d will be replaced with a counter
pagestpl="value"Path to a template for generating a list of pages relative to main template file.
prevtpl="value"Path to a template used in pagestpl to create a link to a previous page relative to main template file.
nexttpl="value"Path to a template used in pagestpl to create a link to a next page relative to main template file.
pagelinktpl="value"Path to a template used in pagestpl to create a link to a certain page number relative to main template file.
pagecurtpl="value"Path to a template used in pagestpl to output current page number relative to main template file.
copyfile="file1<->file2"Copy file1 to file2
fullstar="value"Path to the full star image. (relative to resulting text file)
halfstar="value"Path to the half star image. (relative to resulting text file)
nonestar="value"Path to the empty star image. (relative to resulting text file)
itemsperpage="value"Number of movies per page
« Last Edit: April 12, 2010, 01:48:41 am by nostra »
Gentlemen, you can’t fight in here! This is the War Room!

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Creating templates for export plugin
« Reply #1 on: December 05, 2007, 08:44:47 pm »
File header can be placed between tag: %HEAD%
File footer can be placed between tag: %FOOT%
Ex.:
Code: [Select]
%HEAD%<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>My Video Database</title>
</head>
<body>
%HEAD%
Template Example
%FOOT%
</body>
</html>%FOOT%


Variables

Variables are formatted like this: {%value=[number] oprion1="value" optionN="value"}
There are also some special variables:
{%value}(without number or options) is used in subtemplates for fields with multiple values, pages subtemplates for page numbers and in rating subtemplates (rating as stars) for rating value.
{%param=[value]} is used in subtemplates for fields with different types of data associated (for example actors field can include such information as person id (pid), names, URL, role)
{%groupparam=[value]} is used in subtemplates that support grouping (for example: awards, filmography) to identify by what parameter values should be gouped


Varables for information fields:
Movies:
Field nameNumberOptions
MID0
Num1
Title2
Origtitle3
Aka4
Year5
MPAA6
Release7
URL8
IMDBRating9template
Rating10template
OtherRating11template
OtherName12
Location13
Tagline14
Description15
Comment16
DateAdded17
Quality18
Length19
Translation20
Resolution21
FrameRate22
VideoCodec23
VideoBitrate24
AudioBitrate25
Size26
Path27
MediaType28
MediaCount29
Features30
Barcode31
Viewed32
ViewDate33
Wish34
Bookmark35
Loaned36
Series37
EPID38
Visible39
ParentSeason40
Episode41
Season42
AudioCodec43template, maxvalues
Genres44template, maxvalues
Countries45template, maxvalues
Category46template, maxvalues
Labels47template, maxvalues
Languages48template, maxvalues
Subs49template, maxvalues
Studios50template, maxvalues
Tags51template, maxvalues
Actors52template, maxvalues, params
Directors53template, maxvalues, params
Writers54template, maxvalues, params
Composers55template, maxvalues, params
Producers56template, maxvalues, params
Borrower57
LoanDate58
LoanPeriod59
UserMail60
Links61template, grouptemplate
Awards62template, grouptemplate
Poster63width, height, template, maxvalues, params
Screenshots64width, height, template, maxvalues, params
FrontCover65width, height, template, maxvalues, params
CDCover66width, height, template, maxvalues, params
Credits67template, grouptemplate
Episodes68template, grouptemplate


Persons:
PID0
Name1
TransName2
AltNames3
Birthday4
Death5
Birthplace6
URL7
Rating8
Bio9
Comment10
Bookmark11
Visible12
Genres13template, maxvalues
Filmography14template, grouptemplate
Career15template, maxvalues
Awards16template, grouptemplate
Photo17width, height, template, maxvalues, params


Meaning of the options:
widthMaximum image width
heightMaximum image height
templatePath to subtemplate for fields with multiple values
grouptemplatePath to group subtemplate for fields that support grouping
maxvaluesMaximum values count for fields with multiple values
paramsif param="full" is set, all associated data is retrieved
customthe field is a custom field and the number after value= is it's position


Possible values for {%param=[value]}:
FieldValues
Actorspid, name, transname, url, role
Directospid, name, transname, url, role
Producerspid, name, transname, url, role
Writerspid, name, transname, url, role
Composerspid, name, transname, url, role
Linksmid, linktype, linkname, num, title, origtitle, year, imdbrating, rating, description, url
Awardsevent, year, result, award, category
Episodesepid, mid, epnum, season, num, title, origtitle, year, imdbrating, rating, description, url
Creditsctype, pid, name, transname, url, role
Filmographyctype, ctypestr, mid, title, origtitle, year, role, url
All image fieldsimgid, imgformat, imgpath


Other variables:
NumberMeaning
200Total records count
201Total pages count
202Current page number
203Current record number
204Path to the database file (including file name)
205Database name
206Path to the first page (HTML)
207Path to the index file for the current record (HTML)
208Path to the last page (HTML)
209Path to the previous page (HTML)
210Path to the next page (HTML)
211Insert pages template
212List of pages
213Insert previous page template
214Insert next page template
215Path to the current record's file (HTML)
216Path to the previous record's file (HTML)
217Path to the next record's file (HTML)
218Path to a certain page (HTML)
219Path to the first page
220Path to the index file for the current record
221Path to the last page
222Path to the previous page
223Path to the next page
224Path to the current record's file
225Path to the previous record's file
226Path to the next record's file
« Last Edit: May 13, 2008, 01:07:37 am by nostra »
Gentlemen, you can’t fight in here! This is the War Room!