{% from "_includes/forms" import textareaField %} {{ textareaField({ id: name, name: name, label: 'Radio Button Options', instructions: 'JSON format. Twig code is allowed encouraged :)', rows: 7, class: 'code', value: settings.json }) }} {% verbatim %}

Quick start

'Copy & Paste' one of the following examples into the textarea above.

1. Simple example

{ "value":"jim" , "label":"Jim Beam" },
{ "value":"jack" , "label":"Jack Daniels" , "default":true },
{ "value":"mark" , "label":"Maker's Mark" }

2. Twig example

{% for entry in craft.entries.limit(null).order('title') %}
    { "value":"{{ entry.id }}" , "label":"{{ entry | raw }}"
        {% if entry.uri == '__home__' %} , "default":true{% endif %}
    }{% if not loop.last %},{% endif %}
{% endfor %}

3. Template example

{% include '_dynamicfields/sections' ignore missing %}

Example code for /craft/templates/_dynamicfields/sections.html

{% for section in craft.sections.getAllSections() %}
    { "value":"{{ section.id }}" , "label":"{{ section | raw }}" }
    {% if not loop.last %},{% endif %}
{% endfor %}

{% endverbatim %}