Plugin screenshot thumbnail 1/2
Plugin screenshot thumbnail 2/2

A field type for selecting fields.

Usage

When editing a Craft element, the input for a Field Field resembles a Multi Select field. When editing a Field Field's settings, the allowed field groups can be chosen. (See screenshots)

Template examples

Accessing a Craft element's field value for a Field Field returns a FieldCollection of the selected fields. The main idea behind Field Field was to make it easy to refer to different fields in different entries within the same entry type; how exactly you'd work with the Field Field value to achieve this depends on whether you've selected one or many fields, but generally involves calling the Craft element's getFieldValue() method with the handle(s) of the selected field(s).

One field selected

{% set field = entry.fieldField.one() %}
{% set fieldValue = entry.getFieldValue(field.handle) %}
{# ... #}

Multiple fields selected

{% for field in entry.fieldField.all() %}
    {% set fieldValue = entry.getFieldValue(field.handle) %}
    {# ... #}
{% endfor %}
Installation Instructions

To install this plugin, copy the command above to your terminal.

Reviews

This plugin doesn't have any reviews.

Active Installs
14
Version
2.0.0
License
MIT
Compatibility
Craft 4, Craft 5
Last release
March 26, 2024
Categories
Activity (30 days)
0
Closed Issues
0
Open Issues
0
Merged PRs
0
Open PRs