Super Dynamic Fields

Developer

Amici Infotech

3rd Party (Free)

24 downloads (last 90 days)

MIT License Download v1.0.3

EE Version Support

  • ExpressionEngine 4
  • ExpressionEngine 5

Compatibility

If an item is crossed out, it might be untested, not applicable or incompatible. Contact the developer to be sure.

Requirements

Add-On Type(s)

Fieldtype

Tags

Super dynamic field is created to enhance default radio, checkbox, select dropdown. Instead of adding key/values in field settings, You can now include any EE template where you can add JSON variable for options. If you have tons of fields with options and you dont want to add options in each field, this is best plugin for you. This field produce Checkboxes, Radio buttons and Select dropdown. This fieldtype supports backend and frontend channel forms including normal fields, GRID and Fluid field types. Most important use is, As it comes from template, You can use any EE tags to generate options.

There is 2 way to pass JSON as options in field. Either add JSON manually or select any template which has nothing but a JSON. Remember that JSON needs a valid format. This format would be:
[
{“value” : “option1”, “label” : “Option 1”},
{“value” : “option2”, “label” : “Option 2”, “default” : “yes”},
{“value” : “option3”, “label” : “Option 3”},
]

Where value is value of option, label is label of that option. There is an optional parameter named ‘default’. If you pass that, that option will be pre-selected on creating new entries.

To populate data on front-end, there is several ways to enhance and customize output.

Example 1: (single line code)
{my_super_dynamic_field}

// Output for Radio and Select dropdown (data: option1)
option1

// Output for Checkboxes (data: option1|option3)
option1, option3
Example 2: (wrap output in ul/ol )
{my_super_dynamic_field markup="ul"} // or markup="ol"

// Output (data: option1|option3)
<ul>
    <li>option1</li>
    <li>option3</li>
</ul>
Example 3: (tag pair way to get data)
{my_super_dynamic_field}
    {if item:count == 1} Total results are: {item:total_results} <br>{/if}
    {item:count} : {item} - {item:label} - {item:value} <br>
{/my_super_dynamic_field}

// Output (data: option1|option3)
Total results are: 2
1 : option1 - Option 1 - option1 
2 : option3 - Option 3 - option3
Example 4: (give prefix in tag pair code)
{my_super_dynamic_field prefix="msd"}
    {if msd:count == 1} Total results are: {msd:total_results} <br>{/if}
    {msd:count} : {msd} - {msd:label} - {msd:value} <br>
{/my_super_dynamic_field}

// Output (data: option1|option3)
Total results are: 2
1 : option1 - Option 1 - option1 
2 : option3 - Option 3 - option3
Example 5: (pass limit parameter)
{my_super_dynamic_field limit="1"}
    {if item:count == 1} Displaying {item:total_results} from total of {item:absolute_results}<br>{/if}
    {item:count} : {item} - {item:label} - {item:value} <br>
{/my_super_dynamic_field}

// Output (data: option1|option3)
Displaying 1 from total of 2
1 : option1 - Option 1 - option1
Example 6: (convert on your own way)
{my_super_dynamic_field limit="5" backspace="2"}{item:value}, {/my_super_dynamic_field}

// Output (data: option1|option3)
option1, option2
Template Tags

{exp:super_dynamic_fields:parse}

Parameters
  • prefix=“sd” // Default prefix is: item
  • field_id=“10” // ID of super dynamic fields Field you want all options of.
  • field_name=“my_field_short_name” // Short name of super dynamic fields Field you want all options of.
Variables
  • prefix:count // Count of loop
  • prefix:option_name // Option label
  • prefix:option_value // Option Value
  • prefix:default // TRUE or FALSE
  • prefix:total_results //Total number of rows in loop
Example:
<select name="super_dynamic">
    {exp:super_dynamic_fields:parse field_name="super_dynamic" prefix="item"}
    <option value="{item:option_value}">{item:option_name}</option>
    {/exp:super_dynamic_fields:parse}
</select>
More Complex Example:
<select name="super_dynamic">
{exp:super_dynamic_fields:parse field_name="super_dynamic" prefix="item"}
    <option value="{item:option_value}" 
        {if super_dynamic != ""}
            // If there is already value in field. Case: [Edit form, Submit form inline with post data.]
            {if super_dynamic == item:option_value}selected{/if} 
        {if:elseif item:default} 
            // If marked pre selected
            selected 
        {/if}
    >
        {item:option_name}
    </option>
    {/exp:super_dynamic_fields:parse}
</select>
{if error:super_dynamic}{error:super_dynamic}
{/if}

Changelog

v1.0.1

     
  • Solved a bug where in EE5 dropdown field not rendering with react code.
  •  
  • Solved a bug where field settings was not properly click on under GRID field.
  •  
  • Added condition in save field so it not save empty value.

v1.0.2

  • Added {exp:super_dynamic_fields:parse} tag to get all options of given field.

v1.0.3

  • Solved a bug where special characters in Lable (Option name) were showing HTML entities.

Download Super Dynamic Fields

EE Support Downloads Add-On Version Release Date
4.0.0+ Download 1.0.3 Jun 20, 2019

This entry was created March 16, 2019, 8:37 am.
This entry was last updated June 19, 2019, 11:40 pm.

Disclaimer: Information about ExpressionEngine add-ons is provided as a service to you, the user, and every member of the ExpressionEngine community. devot:ee is not responsible if you hose, mangle, wreck, or otherwise destroy your EE website by installing an add-on that you found out about at this site, regardless of its rating, Favorites status, commercial or free status, or general popularity. Caveat EEmptor!

Returns: devot:ee has a 30-day return policy on all commercial add-ons sold through devot-ee.com. If you need to return an add-on, do not go to the developer or the developer's site, but rather visit our returns page at https://devot-ee.com/returns to initiate your return. If you have questions, email support@devot-ee.com.

1 Review:

rKern 06.20.19

Rating - {addon_rating_average}

Works very well & fills a need.  Dev has been very prompt looking at issues too. This will be a standard in my installs.