'label' => string Label text for this field,
'placeholder' => string Placeholder string,
'required' => boolean True if required,
- 'maxwidth' => integer Size of input field in characters,
+ 'maxwidth' => string Size of input field using standard style notation ('900px', '15rem', ...),
'maxlength' => integer Maximum number of characters that may be entered,
'helptext' => string Help text for this input,
'errtext' => string Error text that appears when the field doesn't validate
{if $fieldData.required}required{/if}
{if isset($fieldData.helptext)}aria-describedby="{$fieldData.field}_HelpText"{/if}
{if isset($fieldData.required)}required{/if} placeholder="{$fieldData.placeholder}"
- {if isset($fieldData.maxwidth)}style="max-width: {$fieldData.maxwidth}rem"{/if}
+ {if isset($fieldData.maxwidth)}style="max-width: {$fieldData.maxwidth}"{/if}
{if isset($fieldData.maxlength)}max-length="{$fieldData.maxwidth}"{/if}
/>
{if isset($fieldData.helptext)}<p class="help-text" id="{$fieldData.field}_HelpText">{$fieldData.helptext}</p>{/if}
'label' => string Label text for this field,
'placeholder' => string Placeholder string,
'required' => boolean True if required,
- 'maxwidth' => integer Size of input field in characters,
+ 'maxwidth' => string Size of input field using standard style notation ('900px', '15rem', ...),
+
'maxlength' => integer Maximum number of characters that may be entered,
'helptext' => string Help text for this input,
'errtext' => string Error text that appears when the field doesn't validate
{else} {* Using simple field *}
<div class="small-12 columns">
<label class="{if $fieldData.required} glm-required{/if}">{$fieldData.label}:
- {wp_editor(
- ${$fieldData.field},
- $fieldData.field,
- json_decode('{
+ <div
+ {if isset($fieldData.maxwidth)}style="width: {$fieldData.maxwidth} !important;"{/if}
+ >
+ {$editorOptions = '
+ {
"media_buttons": false,
- "quicktags": false,
- "textarea_name": "cookie_message",
- "editor_height": 50
- }', true)
- )}
- {if isset($fieldData.helptext)}<p class="help-text" id="{$fieldData.field}_HelpText">{$fieldData.helptext}</p>{/if}
- {if isset($fieldData.errortext)}<span class="form-error">{$fieldData.errortext}</span>{/if}
+ "quicktags": false'
+ }
+ {if isset($fieldData.height)}{$editorOptions = $editorOptions|cat:',
+ "editor_height": '|cat:$fieldData.height}{/if}
+ {if isset($fieldData.rows)}{$editorOptions = $editorOptions|cat:',
+ "textarea_rows": '|cat:$fieldData.rows}{/if}
+ {$editorOptions = $editorOptions|cat:'
+ }'}
+ {wp_editor(
+ ${$fieldData.field},
+ $fieldData.field,
+ json_decode($editorOptions, true)
+ )}
+
+ {if isset($fieldData.helptext)}<p class="help-text" id="{$fieldData.field}_HelpText">{$fieldData.helptext}</p>{/if}
+ {if isset($fieldData.errortext)}<span class="form-error">{$fieldData.errortext}</span>{/if}
+ </div>
</label>
</div>
{/if}