tv2regionerne/statamic-reverse-relationship
Composer 安装命令:
composer require tv2regionerne/statamic-reverse-relationship
包简介
README 文档
README
Overview
Reverse Relationship is an innovative Statamic addon that simplifies the management of one-to-many and many-to-one relationships in your Statamic projects.
This package eliminates the need to create and sync a relationship column in both collections, ensuring a more streamlined and efficient workflow.
Key Features
- Effortless Relationship Management: Easily set up one-to-many and many-to-one relationships without the need for duplicating relationship columns in both collections.
- Antlers Template Support: Utilize the field in Antlers templates to fetch related entries with minimal effort.
- Configurable Fieldtype: Customizable settings for selecting related collections or taxonomies, defining the relationship field, and sorting the displayed entries.
- Automated Data Synchronization: Keeps your relationship data consistent and synchronized automatically.
Installation
- Install the addon via Composer:
composer require tv2regionerne/statamic-reverse-relationship
Configuration and Usage
Setting up Relationships
One-to-Many Relationship:
- In the 'many' side collection's blueprint (e.g., Episodes), create an 'Entries' fieldtype (e.g., series) with a maximum of one entry, pointing to the 'one' side collection (e.g., Series).
Many-to-One Relationship:
- In the 'one' side collection's blueprint (e.g., Series), add the Reverse Relationship fieldtype with a configuration pointing to the 'many' side collection (e.g., Episodes) and the specific relationship field (e.g., series).
Example: Series and Episodes
Episodes Collection Blueprint:
Add an 'Entries' fieldtype named 'series', limited to 1 entry, linked to the Series collection.

Series Collection Blueprint:
Add a Reverse Relationship fieldtype named 'Episodes', configured to the Episodes collection and the 'series' field.

In Templates
Fetch related entries in Antlers templates using the Reverse Relationship field:
{{ collection:series }}
{{ title }}<br>
<ul>
{{ episodes scope="episode" }}
<li>{{ episode:title }}</li>
{{ /episodes }}
</ul>
{{ /collection:series }}
Limitations
The addon does not support many-to-many relationships.
Correct setup of relationship fields in collections or taxonomies is crucial for proper functionality.
Support
For queries, issues, or requests, visit our GitHub issues page.
https://github.com/tv2regionerne/statamic-reverse-relationship/issues
tv2regionerne/statamic-reverse-relationship 适用场景与选型建议
tv2regionerne/statamic-reverse-relationship 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.9k 次下载、GitHub Stars 达 3, 最近一次更新时间为 2023 年 11 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 tv2regionerne/statamic-reverse-relationship 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 tv2regionerne/statamic-reverse-relationship 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 2.9k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2023-11-20