Cockpit CMS Custom Collections and Singletons Development

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Showing 1 of 1 servicesAll 2065 services
Cockpit CMS Custom Collections and Singletons Development
Simple
from 1 business day to 3 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    847
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

Development of Custom Collections and Singletons in Cockpit CMS

Collections and Singletons are the two main types of content in Cockpit. Collections are for repeating entries (articles, products), Singletons are for unique sets of fields (homepage settings, about page).

Creating a Collection via API

// Cockpit allows creating collections through Admin UI or programmatically
// POST /api/collections/createCollection

$collection = [
  'name' => 'products',
  'label' => 'Products',
  'fields' => [
    ['name' => 'title', 'type' => 'text', 'required' => true, 'label' => 'Title'],
    ['name' => 'slug', 'type' => 'text', 'required' => true, 'slug' => true],
    ['name' => 'description', 'type' => 'wysiwyg', 'label' => 'Description'],
    ['name' => 'price', 'type' => 'number', 'label' => 'Price'],
    ['name' => 'image', 'type' => 'asset', 'label' => 'Photo'],
    ['name' => 'gallery', 'type' => 'gallery', 'label' => 'Gallery'],
    ['name' => 'category', 'type' => 'collectionlink', 'link' => 'categories'],
    ['name' => 'published', 'type' => 'boolean', 'default' => false],
    ['name' => 'publishedAt', 'type' => 'date'],
  ],
  'sortable' => true,
  'in_menu' => true,
];

Cockpit Field Types

Type Description
text String
textarea Multiline text
wysiwyg Rich text editor
markdown Markdown
number Number
boolean Toggle switch
select Dropdown list
asset File/image
gallery Image gallery
date / time Date/time
color Color picker
collectionlink Link to another collection entry
repeater Repeating field groups
layout Block builder
object JSON object
tags Tags (array of strings)
set Field group

Singleton

A Singleton differs from a Collection in that it stores a single set of values:

// Singleton "homepage" structure
{
  "fields": [
    { "name": "hero_title", "type": "text" },
    { "name": "hero_subtitle", "type": "textarea" },
    { "name": "hero_image", "type": "asset" },
    { "name": "featured_posts", "type": "collectionlink", "link": "posts", "multiple": true },
    { "name": "seo_title", "type": "text" },
    { "name": "seo_description", "type": "textarea" }
  ]
}

Using Repeater for Content Blocks

Repeater allows the editor to add any number of identical blocks:

{
  "name": "features",
  "type": "repeater",
  "label": "Features",
  "fields": [
    { "name": "icon", "type": "asset" },
    { "name": "title", "type": "text" },
    { "name": "description", "type": "textarea" }
  ]
}

Setting up 3–5 collections with typical fields and relationships takes 4–8 hours.