User Tools

Site Tools

Translations of this page?:


This is an old revision of the document!

A PCRE internal error occured. This might be caused by a faulty plugin

====== Templates ====== Template in **Geckos** are the heart of the engine. Without it, no card can be edited. But what is a Template exactly, and how can you make your own ? ===== Template's Overview ===== A template is a JSON object. It's a way of formatting information so that the engine of **Geckos** understand it. To create such a file, simply create a text file, with for example the name ''myTemplate.json''. Here's the skeleton of the file : <code javascript template-base.json> { "description": { }, "fonts" : [ ], "sharedOptions": [ ], "styles" : [ ] }; </code> ===== Description ===== Description of the template is stored in a ''description'' object. Currently, four items can be set : <code javascript> "description": { "description": "Basic template for Pulp Alley", "title":"Pulp Alley", "credits": "by Nicolas Ronvel", "url": "" }, </code> These informations are displayed in the Template part of the UI, when a Template has been loaded. ===== Custom Fonts ===== The ''fonts'' element in the template is optional. Any template will work even if it's missing. If you need specific font inside your template, that you're not sure the users will have them installed on their computer, then it's a good idea to use this part of the template. See [[custom-fonts|Custom Fonts]] for an explanation on how to add a font to your template. ===== Shared Options ===== This part is described in the [[choice_input#sharing_options|Dropdown Menu page]]. ===== Styles ===== The ''styles'' part of a template stores the elements that will generate the image. It includes the size of the card, the editable fields, the card elements, ... Each template can include numerous styles (for different languages, with different design but same data, ...), and that's why ''styles'' is an array of different styles. See the [[styles|Styles]] section for a more complete description of a Style. ===== Webfonts ===== Since the release 0.3.0 (Beta 3), it is possible to add webfonts dynamically

en/template/start.1497875799.txt.gz · Last modified: 2017/06/19 14:36 by Nicolas Ronvel