User Tools

Site Tools

Translations of this page?:

en:template:image_input

This is an old revision of the document!


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

====== Image fields ====== **Image** fields allow the user to import an image from his computer to the card. An //Open file// window is opened, and the user can select his image file. An [:user:Image Editor]] is then opened, and the user can choose to /crop/ the image (making it to the right ratio). The image is then stored inside the page to be displayed on the card. <code> "fields": [ { "name": "portray", "label": "Portray", "type": "image", "ratio": 16 / 9 }, ] </code> To set a field to the **Image** type, set the ''type'' property to ''image''. No default value is required. The ''ratio'' property is an optional value, with a default value of 1. It accepts a numeric value representing the ratio of the image width by the height. The best way to get a correct value is to set the value to the width / height of the image canvas field related to this editable field. A 1 will result in a square cropping area. ===== Using the variable ===== An image field stores the image as a [[https://en.wikipedia.org/wiki/Data_URI_scheme|Data-Url]]. Inside the canvas, when a property requires an url to an image, you can then instead set it to the variable ''$portray''. See also the [[Dataurl variables]].

en/template/image_input.1485266253.txt.gz · Last modified: 2017/01/24 14:57 by Nicolas Ronvel