Download the PHP package sheadawson/silverstripe-blocks without Composer

On this page you can find all versions of the php package sheadawson/silverstripe-blocks. 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-blocks

SilverStripe Blocks

Build Status Scrutinizer Code Quality codecov

The Blocks modules aims to provide developers with a flexible foundation for defining reusable blocks of content or widgets that can be managed in the CMS.

Notice

This module is no longer maintained. If you would like to adopt it and give it a good home please submit your interest and I will be happy to discuss.

Features

Upgrading from 0.x

See the upgrade guide

Requirements

Recommended

Installation

Install via composer, run dev/build

Quickstart

1. Define Block Areas and Settings for your project in mysite/_config/config.yml

Remember to run ?flush=1 after modifying your .yml config to make sure it gets applied.

2. Add Block Areas to your templates

Adding the BeforeContent and AfterContent blocks would look something like

$BlockArea(BeforeContent) will loop over and display all blocks assigned to the BeforeContent area on the current page

You can limit a block area to a maximum number of blocks using the second limit parameter

3. Add Blocks to a page in the CMS

You will now be able to add Blocks to Pages via the CMS page edit view and in the Blocks model admin. You can also define "BlockSets" in the Blocks model admin. BlockSets can be used to apply a common collection of blocks to pages that match the criteria you define on the set.

This module ships with a basic ContentBlock, but this can be disabled through the `BlockManager::use_default_blocks config.

Help

Restrict Blocks to viewer groups or logged in users

When editing a block, you can restrict who can see it in the frontend by selecting "logged in users" or "users from these groups" under the Viewer Groups tab.

Templates

There are 2 types of templates you should be aware of.

BlockArea Template

The BlockArea template is responsible for looping over and rendering all blocks in that area. You can override this by creating a copy of the default BlockArea.ss and placing it in your templates/Includes folder.

It's likely that your block areas may require different templates. You can achieve this by creating a BlockArea_{AreaName}.ss template.

Block Template

Each subclass of Block requires it's own template with the same name as the class. So, SlideshowBlock.php would have a SlideshowBlock.ss template. If your block requires different templates depending on the BlockArea it's in, you can create SlideshowBlock_{AreaName}.ss

The current page scope can be accessed from Block templates with $CurrentPage.

Block Area Preview

To aid website admins in identifying the areas they can apply blocks to, a "Preview Block Areas for this page" button is available in the cms. This opens the frontend view of the page in a new tab with ?block_preview=1. In Block Preview mode, Block Areas in the template are highlighted and labeled.

There is some markup required in your BlockArea templates to facilitate this: The css class block-area and the data-areaid='$AreaID' attribute.

Form Blocks

As of v1.0 Blocks can now handle forms. See this gist for as an example:

Remove the Blocks button from the main CMS menu

The BlockAdmin section is not always needed to be used. If you wish, you can remove the button from the menu by inserting this to mysite/_config.php:

Block icons

Until this module properly supports icons, you can define icons by creating a getTypeForGridfield method in your block. Here's an example that uses font awesome:

Translatable Blocks

For creating Blocks with translatable content, using the translatble module, see this gist for a kick start.

Screenshots

Overview

Preview of block locations

Edit a block

Add an existing block

TODO


All versions of silverstripe-blocks 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 sheadawson/silverstripe-blocks contains the following files

Loading the files please wait ....