Download the PHP package toastnz/blocks-layouts without Composer

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

SilverStripe Blocks

Simple content blocks system. Nothing fancy, easy to implement.

Requirements

See composer.json

Installation

Add the following to your config.yml (optional):

Use Page or other class that extends SiteTree.

In your Layout/Page.ss template, add the following:

Configuration

Add / remove available block classes

Position page template content between blocks

Add / remove available alternate block layouts

"layout_src": directory that holds folders of different layouts with .ss templates "layout_icon_src": directory that holds all the layout icons "layout_dist_dir": specificed the css for block layouts

CSS file will only be included with the syntax of 'theme/themename/dist/styles/$LayoutName-$BlockType.css"

Ensure there are at least one CustomBlock.ss and 'customblock.svg' icon in each of the specified directory. Layout will be available for all subsites.

.ss template naming

You may have multiple layouts, please ensure you have the block.ss created under a new layout folder in the src directory. e.g. 'app/templates/Toast/Blocks/CustomLayoutNameOne/ImageBlock.ss' or 'app/templates/Toast/Blocks/CustomLayoutNameTwo/ImageBlock.ss'

Layout icon naming:

Please ensure the layout icon are named after the block name are all in lowercase, e.g. customblock.svg. e.g. 'app/client/images/layout-icons/customlayoutone/customblock.svg' or 'app/templates/Toast/Blocks/customlayouttwo/customblock.svg'

Icon extensions

Allowed extension: 'jpg', 'jpeg', 'png', 'gif', 'bmp', 'svg'

Per-layout configuration (labels, icons, disabling)

Use layout_config on any block class to customise the label or icon shown in the CMS layout picker, or to disable a layout entirely. Keys are short layout folder names (e.g. Default, Split).

View the available icon classes here: client/fonts/layout-icons/font/preview.html

Supported keys per layout entry:

Key Type Description
label string Display label shown beneath the icon in the CMS picker
layout_icon_path string Path to an SVG file. Supports the [resources] token. Highest priority.
layout_icon_class string CSS class for an icon font or sprite. Overrides directory discovery.
disabled bool Set true to hide this layout from the CMS picker

Icon resolution priority: layout_icon_path → layout_icon_class → auto-discovered SVG from layout_icon_src directory.

Full class-name keys (e.g. Toast\Blocks\Default\TextBlock) are still supported for backward compatibility.

Excluding layouts

Use exclude_layouts alongside layout_config to hide one or more layouts from the picker without specifying full config entries. This is the quickest way to remove a layout.

Precedence rules:

Fallback when a saved layout is removed

If a block record has a previously saved layout that is later excluded or disabled, the block will automatically fall back to the Default layout at render time and on next save. If Default is also unavailable, the first available layout is used instead.

When a content editor opens such a block in the CMS, a warning notice will appear above the layout picker advising them that the previous layout is no longer available and prompting them to select a replacement and save.

Create a custom block

Extend Block to create a new block type.

/themes/default/templates/Toast/Blocks/MyBlock.ss:

Block Method Reference

The Toast\Blocks\Block class exposes the following methods.

Public methods

Rendering and CMS

Display and metadata

Linking and preview

Page relationships

Permissions and lifecycle

Key protected methods for subclasses

These are not part of the public API, but are useful if you extend Block and override behavior.

Todo:


All versions of blocks-layouts with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
silverstripe/cms Version ^6
silverstripe/userforms Version ^7
axllent/silverstripe-form-fields Version ^2.0
toastnz/open-cms-preview Version ^0.2.2
silverstripe/linkfield Version ^5.1
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 toastnz/blocks-layouts contains the following files

Loading the files please wait ...