Download the PHP package cita/silverstripe-modular without Composer

On this page you can find all versions of the php package cita/silverstripe-modular. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package silverstripe-modular

Scrutinizer Code Quality Build Status Code Intelligence Status

CitaNZ's SilverStripe modular module

Requires: SilverStripe 4.0+

CitaNZ Modular is a lightweight block module which uses ManymanyList to link the pages and the content blocks, and builds the site with the "modulated" concept.

It not only allows the users to reuse the same blocks on different pages across site, but also give the developer a safe fall protection when a block class becomes unavailable (e.g. a deleted block subclass will fall back to Block::cass, instead of crashing the block edit list in the CMS).

Installation

Make sure you also /dev/build?flush=all on the web too

Enable Modular on the class

Please note: if the page's Content field is already in use, then DO NOT enable this module!!!

Add $modulated static variable to the class

and then flush the site cache (/?flush=all)

Build your on Modular blocks

Create a new class, and extend it from Cita\Modular\Model\Block

Allowing/Disallowing block types

below line will only allow BlockA::class, BlockB::class and BlockC::class on the page

below line will exclude BlockA::class, BlockB::class and BlockC::class from the available block types;

Frontend

To print the modular list, just place $Modulars in the .ss files where it's needed

Templating

When a new block subclass is created, the default Block class template (Cita\Modular\Model\Block) will be applied to keep the frontend page stick together. The next step is to create the new subclass's template (make sure it matches the correct namespace), and then flush the cache on the browser -- now all you need to do is to build your block's HTML in the template file and style it with your frontend skills.

Overriding CitaNZ's modular default templates

If you need to tweak the default block's HTML and/or change how the modular blocks get listed on the page, please follow the steps:

  1. cp -rf vendor/cita/silverstripe-modular/templates/Cita your_theme/templates/. (replace your_theme accordingly...)
  2. flush (on the browser)
  3. inspect the .ss files in it
  4. do your thing

Caching

To enable cache for a particular block type, add below to the block type's class

and define the getCacheInvalidator function, and build the conditions for when the cache should be invalidated.

Below is the default invalidator:

It's looking at the block type, block id, and the last edited datetime.

Flex Block

Flex block offers you a quick way to group different blocks in a flex row. If you are using Vuetify or Bootstrap or something similar in your frontend stacks, then all you need to do is to set the column sizes in the CMS. Otherwise, you will have to implement the flexbox by yourself.

Questions?

Q: Why don't you...

A: Pull request plz

Q: I need to do such such such... so can you add this feature blah blah blah...

A: This module is meant to be lightweight, so let's keep it that way. I offer the nose pick, but I don't do the pick! (bet you don't want that either!)


All versions of silverstripe-modular with dependencies

PHP Build Version
Package Version
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package cita/silverstripe-modular contains the following files

Loading the files please wait ....