Misc. D8 Cheat Sheets

Image

I. Use classy paragraphs to add classes to paragraphs as a field, select or autocomplete for Drupal 8

First create classy paragraph styles

  1. In terminal download paragraphs: composer require drupal/paragraphs

  2. Enable paragraphs

  3. In terminal down classy paragraphs: composer require drupal/classy_paragraphs

  4. Enable classy paragraphs

  5. Navigate to structures->classy paragraph style and click “add classy paragraph style” button

  6. Create style classes and labels, must create associated class rules in css.

 

Next create a paragraph field that uses a classy paragraph style.

  1.  Add a field in an existing paragraph.

  2. Select “reference” -> “other”

  3. Add field name

  4. In “type of item to reference” select “classy paragraphs style” 

  5. Also select “unlimited” or “limited” depending on how many styles fields you want available.  (select lists can only deliver one style, but if you change the widget and did not select “unlimited” it’s hard to redo once you create content.

 

II. Block Field

  1. Download block_field module for drupal 8 :  $ composer require drupal/block_field.

  2. In content type or paragraph type add field in “Add a new field” select choose “Block (plugin” under “Reference”).