Coder Social home page Coder Social logo

lullabot / custom_layouts Goto Github PK

View Code? Open in Web Editor NEW
15.0 6.0 6.0 17 KB

Drupal 8 layouts with configurable classes and titles, code to massage Layout Builder block list categories and titles.

License: GNU General Public License v2.0

CSS 11.78% PHP 51.60% Twig 36.62%

custom_layouts's Introduction

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

custom_layouts's People

Contributors

deviantintegral avatar karens avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

custom_layouts's Issues

When using a section title, it goes before regions and then the columns or regions don't display properly

When using a section title, it goes before regions and then the columns or regions don't display properly.
For instance, if you add a section with 2 columns, and you name that section, the title goes to the left of the 2 columns, and then it shows
[title] [column one]
[column two on its own line]

Rather than:
[title]
[column one][column two on same line]

image

Is this correct behavior? It requires fixing with css for every time a section title is used, which seems to mean that none of the section layouts will work as described IF you use a section title, unless you fix it with css.
I think that the section title should have it's own space at the top/above the section regions so that the layout selected is displayed properly.
Perhaps I misunderstand how this section title can be used.

Couldn't install following the ReadMe

About a month ago I tried out this module and had some difficulties. This is just an issue in case you want to fix the READMe process. Following the README process, I couldn't get this module to work. I had to add this module as a custom module in modules/custom as a git sumodule.

The instruction to add lullabot/custom_layouts..... lines however it was into the package.json file and then do the composer require... line would never actually install the module or do anything that I could see. The module worked fine once I added it via git as a git submodule or just via git clone in modules/custom.

Issues don't seem to be addresses but here is feedback anyway - composer.json error

I tried to edit my composer.json according to the instructions with and without a comma and they both fail when running the composer command

"repositories": [
    {
        "type": "composer",
        "url": "https://packages.drupal.org/8"
    } ,
    "lullabot/custom_layouts": {
        "type": "vcs",
        "url": "https://github.com/lullabot/custom_layouts.git",
        "no-api": true
    }
],

With the comma I get
[Seld\JsonLint\ParsingException] "./composer.json" does not contain valid JSON Parse error on line 15: ..." } "lullabot/custom_lay... --------------------^ Expected one of: 'EOF', '}', ',', ']'

Without the comma I get
[Seld\JsonLint\ParsingException] "./composer.json" does not contain valid JSON Parse error on line 16: ...abot/custom_layouts": { "typ ----------------------^ Expected one of: 'EOF', '}', ',', ']'

Incorrect template being used

If you use the layout 'layout_onecol_100' within layout builder for a section, the template that is used is the one from layout_discovery.

This seems to be because the definition of the layout includes

path: layouts/onecol 
template: layout--onecol

which is the exact same for the layout discovery. Once I've renamed the template and updated the layout definition in custom_layouts.layouts.yml, it started to work as expected.

Is this some kind of scoping / override not being picked up issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.