承接 tv2regionerne/statamic-reverse-relationship 相关项目开发

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

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

tv2regionerne/statamic-reverse-relationship

最新稳定版本:v1.6.1

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

  1. 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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2023-11-20