承接 eminos/statamic-field-item-relationship 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

eminos/statamic-field-item-relationship

Composer 安装命令:

composer require eminos/statamic-field-item-relationship

包简介

A Statamic addon that adds a Field Item Relationship fieldtype.

README 文档

README

A Statamic addon that adds a Field Item Relationship fieldtype. With Field Item Relationship you can select a value from a source field's items. That source field could be a sibling or ancestor field (in the same blueprint), or come from a Global set.

Installation

Install this addon using composer.

composer require eminos/statamic-field-item-relationship

Statamic support

Statamic version Addon version Addon branch
Statamic 3-5 1.x 1.x
Statamic 6 2.x main

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.
  • 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".

{{ fir:field_item_relationship_field }}

If the source value is an object you get its values like this.

{{ fir:field_item_relationship_field }}
    {{ text_field_1 }}
    {{ some_other_field }}
{{ /fir:field_item_relationship_field }}

Or by specifying the target field in the tag like this:

{{ fir:field_item_relationship_field:text_field_1 }}

Even nested fields work, like this:

{{ fir:field_item_relationship_field:some_field.child_field }}

You can also get Global fields:

{{ fir:global_set:field_item_relationship_field:nested.target.path }}

Another way is to use the field and path parameters:

{{ fir field="global_set:field_item_relationship_field" path="some_field.child_field" }}

Screenshots

A few different examples. Screenshot of different source field types

The field configuration options. Screenshot of the field configuration

Possible improvements

  • Multiselect
  • More selection fieldtype options (in addition to the Select fieldtype)
  • Support Assets fieldtype as source field.

License

The MIT License (MIT). Please see License File for more information.

eminos/statamic-field-item-relationship 适用场景与选型建议

eminos/statamic-field-item-relationship 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6.67k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2023 年 09 月 29 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 eminos/statamic-field-item-relationship 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 eminos/statamic-field-item-relationship 我们能提供哪些服务?
定制开发 / 二次开发

基于 eminos/statamic-field-item-relationship 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 6.67k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-09-29