Download the PHP package eminos/statamic-field-item-relationship without Composer
On this page you can find all versions of the php package eminos/statamic-field-item-relationship. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download eminos/statamic-field-item-relationship
More information about eminos/statamic-field-item-relationship
Files in eminos/statamic-field-item-relationship
Package statamic-field-item-relationship
Short Description A Statamic addon that adds a Field Item Relationship fieldtype.
License MIT
Informations about the package statamic-field-item-relationship
Statamic Field Item Relationship
A Statamic plugin that adds a Field Item Relationship fieldtype.
With Field Item Relationship you can select a value from a source fields' items.
That source field could be a sibling or ancestor field (in the same blueprint), or come from a Global set.
Installation
Install this plugin using composer.
Features
- The source field could be a sibling or ancestor field, or come from a Global set.
- Set which key/field should be used as the select option label.
- Use string literal for advanced option label configuration (see screenshot #4)
- Choose what you want to save as the selected item.
- Key/Index
- Specified object key
- Full item/object
- Comes with a Tag
{{ fir }}
to help you fetch the selected source field item.
Field configuration
The field configuration will depend on the source field data type.
Depending on if the source data is a simple array of strings, an array of objects or an individual object, different "Save as" options will be possible.
You will get a warning message in the field if the field configuration isn't compatible with the source field data.
Tag usage
This fetches the source value from the configured source field in field "field_item_relationship_field".
If the source value is an object you get its values like this.
Or by specifying the target field in the tag like this:
Even nested fields work, like this:
You can also get Global fields:
An other way is to use the field and path parameters:
Screenshots
A few different examples.
A real life example with the source field being in a Global set.
The field configuration options.
Advanced option label configuration.
Possible improvements
- Multiselect
- More selection fieldtype options (in addition to the Select fieldtype)
License
The MIT License (MIT). Please see License File for more information.