eminos / statamic-field-item-relationship
A Statamic addon that adds a Field Item Relationship fieldtype.
Package info
github.com/eminos/statamic-field-item-relationship
Type:statamic-addon
pkg:composer/eminos/statamic-field-item-relationship
Fund package maintenance!
Requires
- php: ^8.3
- statamic/cms: ^6.0
Requires (Dev)
- orchestra/testbench: ^10.0
- pestphp/pest: ^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Pick items from another field. Let editors choose a Grid row, a List value, an image from a gallery or an option from a Global set. The choices always come from the content you already have.
๐ Documentation ยท Getting started ยท The fir tag
Install
composer require eminos/statamic-field-item-relationship
Requires PHP 8.3+ and Statamic 6 (the image grid input type needs Statamic 6.44+). Add a Field Item Relationship field to any blueprint and point it at a source field.
| Statamic version | Add-on version | Branch |
|---|---|---|
| Statamic 3, 4, 5 | 1.x |
1.x |
| Statamic 6 | 2.x |
main |
Features
Any list is a source |
Pick images from a gallery |
Four input types |
Works inside Grid and Replicator |
Your labels, your thumbnails |
The |
Get the picked item back
The field saves a reference: a value, key, index, row ID or object, you choose with Save as. The fir tag looks up the item it points to, from a sibling field or a Global set.
{{ fir:team_lead }}
<strong>{{ name }}</strong>, {{ role }} ยท {{ email }}
{{ /fir:team_lead }}
{{# Assets sources augment to real assets #}}
<img src="{{ glide :src="hero_image" width="1200" }}" alt="{{ hero_image:alt }}">
More examples, every tag syntax and the full field configuration are in the documentation: configuration reference ยท troubleshooting ยท changelog & upgrading.
Development
composer test # Pest npm test # Vitest npm run docs:dev # docs site (VitePress, in docs/); run `npm --prefix docs install` once first
License
The MIT License (MIT). Please see License File for more information.
Made with care by kiwikiwi.