User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

en:tutorial:tutorial03 [2017/11/12 14:14]
Nicolas Ronvel created
en:tutorial:tutorial03 [2017/11/12 14:24]
Nicolas Ronvel [Referencing your template]
Line 33: Line 33:
 </​code>​ </​code>​
 +Editing manually this file is helpful when you want to display / use only a couple of templates. In this example, two templates only are loaded by Geckos.
 +If you don't reference your template in this file, it won't appear on the UI.
 +==== Resource Files ====
 +Many templates use external resource files. You could embed them as [[..:​template:​dataurl_variables|DataURL]],​ but external files are easier to maintain and use in development mode.
 +External files for a template are better all in one place. In the ''​src/​js/​templates''​ directory, create a subdirectory named ''​mytemplate''​. You will put your images and other external files there.
 +When you references those files in your templates, the starting point is coming from ''​src''​ directory. It should look like this in the template : 
 +<code javascript>​
 +"​path":​ "​./​js/​templates/​mytemplate/​myfile.png"​
 +Again, look at existing templates to learn a few tips !
en/tutorial/tutorial03.txt · Last modified: 2017/11/12 14:24 by Nicolas Ronvel