raffaelj / CpMultiplane

small PHP frontend for Cockpit CMS
MIT License
17 stars 3 forks source link

CpMultiplane

A small PHP front end for the fast and headless Cockpit CMS.

Docs (work in progress), i18n


CpMultiplane is not compatible with Cockpit CMS v2.

See also Cockpit CMS v1 docs, Cockpit CMS v1 repo and Cockpit CMS v2 docs, Cockpit CMS v2 repo.


My main goals:

  1. privacy by design and privacy by default
  2. developer friendliness
    • no plugins to deactivate half of the core features needed
    • ability to adjust everything
  3. clean and structured backend for my clients - Cockpit CMS with addons and modifications
  4. structured data - keep the system and the data portable and future proof
  5. modular, small and reusable code
  6. semantic html, responsive css, usable without javascript
  7. multilingualism by design

CpMultiplane is no classic Cockpit addon. It uses Cockpit as a library, registers multiplane as a new module and than uses cockpit's core features. The backend still works as a standalone tool to manage and structure data.

It is the refactored version of Monoplane, which is not maintained anymore.

Requirements

Make also sure that $_SERVER['DOCUMENT_ROOT'] exists and is set correctly.

You can find the detailed version and a cli install example in docs/installation.

Installation

manually

via git

cd ~/html
git clone https://github.com/raffaelj/CpMultiplane.git .
cp .htaccess.dist .htaccess
git clone https://github.com/agentejo/cockpit.git cockpit
git clone https://github.com/raffaelj/cockpit_CpMultiplaneGUI.git cockpit/addons/CpMultiplaneGUI
git clone https://github.com/raffaelj/cockpit_FormValidation.git cockpit/addons/FormValidation
git clone https://github.com/raffaelj/cockpit_UniqueSlugs.git cockpit/addons/UniqueSlugs

via composer

cd ~/html
composer create-project --ignore-platform-reqs raffaelj/cpmultiplane .

If you use composer, Cockpit and the addons CpMultiplaneGUI, FormValidation and UniqueSlugs are installed automatically.

via docker

The docker image comes preinstalled with the quickstart routine of the "basic" template, with a default admin user (password: admin) and with dummy data from installed addons.

This is not meant for production use, but for local development.

docker pull raffaelj/cpmultiplane
docker run --rm -d --name cpmultiplane -p 8080:80 raffaelj/cpmultiplane

Now open your browser on localhost:8080 and see it in action.

Features

Recommended Addons

Install these addons in cockpit/addons/.

Intended use

Backend - Cockpit

  1. Create a singleton site for your default page definitions.
  2. Create a collection pages for all of your pages.
  3. Create a collection posts for all of your blog posts.
  4. Use the CpMultiplaneGUI addon.

Frontend - CpMultiplane

  1. create a child theme of rljbase or create your own theme
  2. adjust defaults in /child-theme/config/config.php
  3. add snippets to /child-theme/bootstrap.php, that are explicitly for your theme
  4. add snippets to /config/bootstrap.php, that are specifically for your setup
  5. change some partials to fit your needs

Settings

The fastest way to change some defaults, is to add some values to /cockpit/config/config.php:

<?php
return [
    'app.name' => 'CpMultiplane',

    'i18n' => 'en',
    'languages' => [
        'default' => 'English',
        'de' => 'Deutsch',
    ],

    // define settings here
    'multiplane' => [
        'pages' => 'pages',
        'siteSingleton' => 'site',
        'slugName' => 'slug',
        'use' => [
            'collections' => [
                'pages',
                'posts',
                'products',
            ],
            'singletons' => [
                'site',
            ],
            'forms' => [
                'contact',
            ],
        ],
    ],
];

The cleaner and more user friendly way is to use the GUI. Create a profile, name it my-profile and set multiplane to the profile name:

return [
    'app.name' => 'CpMultiplane',

    'i18n' => 'en',
    'languages' => [
        'default' => 'English',
        'de' => 'Deutsch',
    ],

    // define settings via profile
    'multiplane' => [
        'profile' => 'my-profile',
    ],
];

Reserved routes

Copyright and License

Copyright 2019 Raffael Jesche under the MIT license.

See LICENSE for more information.

Credits and third party resources

Without Cockpit, CpMultiplane couldn't exist. Thanks to Artur Heinze and to all contributors.