User Tools

Site Tools

Translations of this page?:

en:template:start

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": "https://github.com/Gulix/geckos/" }, </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.

en/template/start.1470842245.txt.gz · Last modified: 2016/08/10 17:17 by Nicolas Ronvel