Skip to content
Drupal 8 layouts with configurable classes and titles, code to massage Layout Builder block list categories and titles.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
css
layouts
src/Plugin/Layout
README.md
composer.json
custom_layouts.info.yml
custom_layouts.layouts.yml
custom_layouts.libraries.yml
custom_layouts.module

README.md

Custom layouts for Layout Builder

Adds custom layouts to Layout Builder, which contain options to add css classes and titles to each section.

  • Several custom layouts are provided here, which can be further adjusted in the theme.
  • Css classes are managed via a vocabulary. There is one vocabulary for general css and another for css to use on titles.
  • We use Chosen to make the class selection super easy. That adds tags-style functionality to the simple selector.
  • The code massages the Layout Builder block list to change some category names and block titles so they make more sense in Layout Builder.

Configuration

  • Navigate to admin > extend and enable the module.
  • The code assumes that vocabularies called classes and title_classes already exist.
  • The code assumes a field called field_class is used on these vocabularies to store the actual classes.
  • The actual class(es) are stored in a field on the term, which means any descriptive title can be used for the name of the class or class collection.

Composer

To include this module in a composer project, add the following to the 'repositories' section of the top level composer.json file:

        "lullabot/custom_layouts": {
            "type": "vcs",
            "url": "https://github.com/lullabot/custom_layouts.git",
            "no-api": true
        }

Then type the following on the command line:

composer require lullabot/custom_layouts
You can’t perform that action at this time.