Multiple Collection Link field Cockpit CMS Add-On
Switch branches/tags
Nothing to show
Clone or download
pauloamgomes Merge pull request #3 from raffaelj/master
relative path to parent dir for edit-collection-link, fixes #2
Latest commit b0510d4 Aug 13, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets forgot to copy the right files for testing, now it works with base_url Jul 29, 2018
LICENSE Initial commit Jan 26, 2018
README.md updated screencast image Aug 13, 2018
admin.php initial commit Jan 26, 2018
bootstrap.php initial commit Jan 26, 2018

README.md

Cockpit-MultipleCollectionLink

Extend Cockpit core fields with a Multiple Collection Link Field.

Installation

  1. Download zip and extract to 'your-cockpit-docroot/addons' (e.g. cockpitcms/addons/multiplecollectionlink)
  2. When adding a new field to your collection the MultipleCollectionLink shall be present

Usage

Field definition is similar to the existing CollectionLink, main difference resides on the links attribute, instead of a collection it consists of an array of collection names:

{
  "links": [
    {
      "name": "colection1",
      "display": "fieldname"
    },
    {
      "name": "collection2",
      "display": "fieldname"
    },
    {
      "name": "collection3",
      "display": "fieldname"
    }
  ],
  "limit": false
}

In the below example and assuming that you have two collections, named carousel and block, you can create a link to them using:

{
  "links": [
    {
      "name": "carousel",
      "display": "name"
    },
    {
      "name": "block",
      "display": "name"
    }
  ],
  "limit": false
}

Example Usage

The name of the link is the collection name and the display is the field name of the collection to be displayed when listing/viewing collections.

The limit consists of a numeric value that restricts the number of linked collections.

Copyright and license

Copyright 2018 pauloamgomes under the MIT license.