English > Development

Creating templates for export plugin

(1/1)

nostra:
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#10filter="value"File filter used in "Save as" dialog. Ex.: HTML Files|*.html;*.htmencoding="value"Text encoding. This parameter can be the following value:
* ANSI - Save as ANSI text (using Windows default code page)
* UTF8 - Save as UTF8sortby="value"Number of the field that should be used for sorting.sortdir="value"Sorting direction.

* sdAscending - Sort Ascending
* sdDescending - Sort Descendingimagepath="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 counterpagestpl="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 file2fullstar="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

nostra:
File header can be placed between tag: %HEAD%
File footer can be placed between tag: %FOOT%
Ex.:

--- Code: ---%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%
--- End code ---


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 nameNumberOptionsMID0Num1Title2Origtitle3Aka4Year5MPAA6Release7URL8IMDBRating9templateRating10templateOtherRating11templateOtherName12Location13Tagline14Description15Comment16DateAdded17Quality18Length19Translation20Resolution21FrameRate22VideoCodec23VideoBitrate24AudioBitrate25Size26Path27MediaType28MediaCount29Features30Barcode31Viewed32ViewDate33Wish34Bookmark35Loaned36Series37EPID38Visible39ParentSeason40Episode41Season42AudioCodec43template, maxvaluesGenres44template, maxvaluesCountries45template, maxvaluesCategory46template, maxvaluesLabels47template, maxvaluesLanguages48template, maxvaluesSubs49template, maxvaluesStudios50template, maxvaluesTags51template, maxvaluesActors52template, maxvalues, paramsDirectors53template, maxvalues, paramsWriters54template, maxvalues, paramsComposers55template, maxvalues, paramsProducers56template, maxvalues, paramsBorrower57LoanDate58LoanPeriod59UserMail60Links61template, grouptemplateAwards62template, grouptemplatePoster63width, height, template, maxvalues, paramsScreenshots64width, height, template, maxvalues, paramsFrontCover65width, height, template, maxvalues, paramsCDCover66width, height, template, maxvalues, paramsCredits67template, grouptemplateEpisodes68template, grouptemplate

Persons:
PID0Name1TransName2AltNames3Birthday4Death5Birthplace6URL7Rating8Bio9Comment10Bookmark11Visible12Genres13template, maxvaluesFilmography14template, grouptemplateCareer15template, maxvaluesAwards16template, grouptemplatePhoto17width, height, template, maxvalues, params

Meaning of the options:
widthMaximum image widthheightMaximum image heighttemplatePath to subtemplate for fields with multiple valuesgrouptemplatePath to group subtemplate for fields that support groupingmaxvaluesMaximum values count for fields with multiple valuesparamsif param="full" is set, all associated data is retrievedcustomthe field is a custom field and the number after value= is it's position

Possible values for {%param=[value]}:
FieldValuesActorspid, name, transname, url, roleDirectospid, name, transname, url, roleProducerspid, name, transname, url, roleWriterspid, name, transname, url, roleComposerspid, name, transname, url, roleLinksmid, linktype, linkname, num, title, origtitle, year, imdbrating, rating, description, urlAwardsevent, year, result, award, categoryEpisodesepid, mid, epnum, season, num, title, origtitle, year, imdbrating, rating, description, urlCreditsctype, pid, name, transname, url, roleFilmographyctype, ctypestr, mid, title, origtitle, year, role, urlAll image fieldsimgid, imgformat, imgpath

Other variables:
NumberMeaning200Total records count201Total pages count202Current page number203Current record number204Path to the database file (including file name)205Database name206Path 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 template212List of pages213Insert previous page template214Insert next page template215Path 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 page220Path to the index file for the current record221Path to the last page222Path to the previous page223Path to the next page224Path to the current record's file225Path to the previous record's file226Path to the next record's file

Navigation

[0] Message Index

Go to full version