Stillat / relationships

Provides automated bi-directional @statamic entry relationships
MIT License
16 stars 1 forks source link

Term saves into other related taxonomy fields #22

Closed mikemartin closed 1 year ago

mikemartin commented 1 year ago

When the related products field in an "activities" term is saved, the term is stored in the product activities field but also stored in all other related taxonomy fields in the entry (categories, features and collections) in the entry.

Screen Shot 2023-05-27 at 8 28 48 am

Relations

        Relate::manyToMany(
            'term:activities.products',
            'pens.activities'
        );

        Relate::manyToMany(
            'term:categories.products',
            'pens.categories'
        );

        Relate::manyToMany(
            'term:ranges.products',
            'pens.ranges'
        );

        Relate::manyToMany(
            'term:activities.products',
            'pens.activities'
        );

        Relate::manyToMany(
            'term:features.products',
            'pens.features'
        );

        Relate::manyToMany(
            'term:collections.products',
            'pens.collections'
        );

Fields

-
            handle: categories
            field:
              type: terms
              taxonomies:
                - categories
              display: Categories
              mode: select
          -
            handle: ranges
            field:
              type: terms
              taxonomies:
                - ranges
              display: Ranges
              mode: select
          -
            handle: activities
            field:
              type: terms
              taxonomies:
                - activities
              display: Activities
              mode: select
          -
            handle: features
            field:
              type: terms
              taxonomies:
                - features
              display: Features
              mode: default
              instructions_position: above
              listable: hidden
              visibility: visible
              create: true
          -
            handle: collections
            field:
              type: terms
              taxonomies:
                - collections
              display: Collections
              mode: select
JohnathonKoster commented 1 year ago

Resolved in 2.0.4 (S4) and 1.2.5 (S3)

mikemartin commented 1 year ago

@JohnathonKoster Thank you again! Looks like I'm all sorted :)