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

====== Rich Text fields ====== **Rich Text** fields are text input fields with control on the text's style. It creates a text input in which the user can type anything he wants, and format the text in **bold** and/or //italic//. This text can then be passed to the card to be displayed. <code javascript> "fields": [ { "name": "myfieldname", "label":"My field", "default": "Default value", "type": "richtext" } ] </code ===== Using the variables ===== With each **Rich Text** field created, some variables are created. You can get the generated ''html'' value of the field by setting a property to the string ''$myfieldname''. This should not come to any use. A much more needed use is the possibility to get the raw text, without any formatting. For this case, use the [[Advanced string variables|Advanced string variable]] ''$myfieldname$'' in the property you need. But, how to get the formatting ? For this, you'll have to set the ''text'' property of a text canvas field (text, textbox, i-text) to the advanced string variable ''$myfieldname$'', and the ''styles'' property to ''£myfieldname''. It's important to not add text **before** the advanced string variable, because the styling is set to match the index of a character in a line (and adding characters modifies index for other characters). <code javascript> "canvasFields": [ { "type": "textbox", "text": "$myfieldname$", "styles": "£myfieldname" } ] </code>

en/template/rich_text_field.1470904518.txt.gz · Last modified: 2016/08/11 10:35 by Nicolas Ronvel