All Projects → pauloamgomes → Cockpit-MultipleCollectionLink

pauloamgomes / Cockpit-MultipleCollectionLink

Licence: MIT License
Multiple Collection Link field Cockpit CMS Add-On

Programming Languages

javascript
184084 projects - #8 most used programming language
PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to Cockpit-MultipleCollectionLink

cockpit-sql-driver
SQL Driver for Cockpit CMS
Stars: ✭ 28 (+27.27%)
Mutual labels:  cockpit-cms
nuxt-cockpit
A Tutorial to Bundle Cockpit CMS & Nuxt.js in a full JAMstack
Stars: ✭ 45 (+104.55%)
Mutual labels:  cockpit-cms
CockpitCMS-React-Static
Example implementation using a combination of Cockpit Headless CMS and React Static
Stars: ✭ 24 (+9.09%)
Mutual labels:  cockpit-cms
CockpitCMS-Helpers
Cockpit CMS Addon with a set of useful helpers (that alone don't justify a new Addon).
Stars: ✭ 39 (+77.27%)
Mutual labels:  cockpit-cms

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.

The addon provides also the flexibility to enhance the display of items in the collection list, by default a tooltip is provided with a number of linked items, but it can be replaced with a list of all links (display val

{
  "links": [
    {
      "name": "carousel",
      "display": "name"
    },
    {
      "name": "block",
      "display": "name"
    }
  ],
  "viewMode": "list"
}

Copyright and license

Copyright 2018 pauloamgomes under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].