PHPackages                             restruct/silverstripe-blockbase - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. restruct/silverstripe-blockbase

ActiveSilverstripe-vendormodule[Utility &amp; Helpers](/categories/utility)

restruct/silverstripe-blockbase
===============================

Various tweaks &amp; enhancements on top of Elemental

1.0.8(2y ago)013MITPHP

Since Aug 30Pushed 2y ago2 watchersCompare

[ Source](https://github.com/restruct/blockbase)[ Packagist](https://packagist.org/packages/restruct/silverstripe-blockbase)[ RSS](/packages/restruct-silverstripe-blockbase/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (10)Used By (0)

Restruct Silverstripe Block Base module
=======================================

[](#restruct-silverstripe-block-base-module)

This module serves as a base on top of Elemental, for blocks based projects by Restruct.

Unset nested blocks .container padding (for first level nested)
---------------------------------------------------------------

[](#unset-nested-blocks-container-padding-for-first-level-nested)

In case your project already wraps blocks inside a .container, the block's .container will have double padding. Below CSS unsets this (based on a project which wraps all content in a subnav and a content .col, adapt to your specific project):

```
.blocks-container {
  // unset padding/margin of (second level ) .container if contained within .subnav-slot-* (before/after)
  &.subnav-slot-before,
  &.subnav-slot-after {
    & > .block-item-wrapper > .container > .row > [class*="col"] > .block-item-wrapper > .container {
      padding: 0;
      // .row & .col* should remain unchanged as there may be multiple columns with a block
    }
  }
}
```

Functionality:
--------------

[](#functionality)

- Various Block (Elemental) tweaks (+ block icon/thumbnail preview route at `admin/blocktypeicons`)
- ...

Show Block design/thumbnails instead of icons in admin UI (Elemental)
---------------------------------------------------------------------

[](#show-block-designthumbnails-instead-of-icons-in-admin-ui-elemental)

1. copy &amp; adapt below section to specific project code css to show designed block previews instead of icons
2. set private static $icon to 'block-design block-section {block-name-offset}'
3. add stacked blocks img to app/client (.block-name-offset sets offset if multiple stacked in one image)

```
i.block-section, button.block-section:before {
  background-image: url(~app/client/imgs/block-group-designs_stacked.png);
  background-position: 0 0;
}
i.block-section, button.block-section {
  &.block-name-offset {&, &:before {
    background-position: 0 -128px;
  }}
  &.block-othername-offset {&, &:before {
    background-position: 0 -28px;
  }}
}
```

Notes
-----

[](#notes)

### Template relations

[](#template-relations)

The DNADesign/Elemental/Models/ElementalArea.ss template loops over each of the element controller instances. Each controller instance will render $ElementHolder which represents the element contained within a holder div. The wrapper div is the ElementHolder.ss template.

### Style layout variants

[](#style-layout-variants)

A list of style layout variants can be set via YAML or `private static $styles`, the first one being the default.

```
Restruct\Silverstripe\BlockBase\Blocks\BlockContent:
  styles:
    single-col-wide: 'Single wide column layout'
    single-col-narrow: 'Single narrow column layout'
    double-col-equal: 'Two equal-width columns layout'
```

The selected $StyleVariant will be available in themplates and is included as class on the wrapper element (DNADesign/Elemental/Layout/BlockHolder.ss). It can also be used to switch between different templates, eg BlockType.ss / BlockType\_single-col-wide.ss / etc.

### Styl(ing) options (ExtraClass)

[](#styling-options-extraclass)

Further styling variations can be controlled by activating one or multiple additional CSS classes to the block holder. Options (eg based on theme) can be set via YAML on a project basis, or directly on the block classes (`private static $style_options`).

```
Restruct\Silverstripe\BlockBase\Blocks\BlockContent:
  style_options:
    - 'light'
    - 'dark'
```

### Advanced config

[](#advanced-config)

Advanced config pointers: [https://github.com/silverstripe/silverstripe-elemental/blob/4/docs/en/advanced\_setup.md](https://github.com/silverstripe/silverstripe-elemental/blob/4/docs/en/advanced_setup.md)

#### Allow/disallow specific block types on subsites

[](#allowdisallow-specific-block-types-on-subsites)

(Handled by `Restruct\Silverstripe\BlockBase\Extensions\SubsitesPageExtension`)

```
Page:

#  # Example: disallow any blocks on subsites
#  subsites_allowed_elements: false

#  # Example: allow specific elements on subsites
#  subsites_allowed_elements:
#    - Restruct\Silverstripe\BlockBase\Blocks\BlockContent

#  # Example: DISallow specific elements on subsites
#  subsites_disallowed_elements:
#    - Restruct\Silverstripe\BlockBase\Blocks\BlockContent
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~62 days

Recently: every ~118 days

Total

9

Last Release

858d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4d3680d6353e5f171543435b89965ba2588186ad7ec0ec97cbf572704fec2a4f?d=identicon)[micschk](/maintainers/micschk)

---

Top Contributors

[![micschk](https://avatars.githubusercontent.com/u/1005986?v=4)](https://github.com/micschk "micschk (15 commits)")

---

Tags

silverstripe

### Embed Badge

![Health badge](/badges/restruct-silverstripe-blockbase/health.svg)

```
[![Health](https://phpackages.com/badges/restruct-silverstripe-blockbase/health.svg)](https://phpackages.com/packages/restruct-silverstripe-blockbase)
```

###  Alternatives

[wedevelopnl/silverstripe-elemental-grid

Elemental grid module

1014.1k2](/packages/wedevelopnl-silverstripe-elemental-grid)[kinglozzer/multiselectfield

A sortable multiple select field for managing many-to-many relations

1341.2k2](/packages/kinglozzer-multiselectfield)[fractas/elemental-stylings

Collection of useful and reusable SilverStripe Elemental stylings properties

1416.4k1](/packages/fractas-elemental-stylings)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
