Resources

Prerequisites

Lessons

Initial Setup

Elemental module:

GitHub - silverstripe/silverstripe-elemental: Create pages in SilverStripe using content blocks

Search Packagist for Elemental block types:

Packagist

Upon converting a page to a blocks page, automatically move any content to a content block:

public function onAfterWrite()
{
    // If just converted: copy any Content to a new Content block
    if($this->Content) {
        if($area = $this->ElementalArea()) {
            if(!$area->Elements()->exists()) {
                $element = ElementContent::create();
                $element->ParentID = $area->ID;
                $element->Title = "Content";
                $element->HTML = $this->Content;
                $element->write();
            }
        }
    }

    parent::onBeforeWrite();
}

Demoed Third Party Blocks

GitHub - dnadesign/silverstripe-elemental-userforms: Adds a new element for usersforms

GitHub - purplespider/silverstripe-elemental-basic-gallery: Basic Gallery Block for the Silverstripe Elemental module

GitHub - dnadesign/silverstripe-elemental-virtual: Allows Content Blocks to be reused between pages.

GitHub - dnadesign/silverstripe-elemental-list: Group Content Blocks into a Single Block

Creating Custom Blocks

Silverstripe Icons:

Storybook