1 of 39

www.drupaleurope.org

2 of 39

Enrich your Paragraphs workflow with �features you didn’t know about

Miloš Bovan

3 of 39

Miloš Bovan

Drupal developer @ MD Systems

drupal.org/u/mbovan

4 of 39

  1. How to apply different styles to the same paragraph type?
  2. How to reuse paragraphs and place them through a library?
  3. How to use Drag&Drop mode to better organize my paragraphs?
  4. How to organize my long list of paragraphs types?
  5. How to extend paragraphs actions and convert one into a different type?
  6. How to properly enable Paragraphs translations?
  7. How to configure Content Moderation publishing workflow and Paragraphs?

Paragraphs FAQ

5 of 39

  1. How to apply different styles to the same paragraph type?

6 of 39

Link paragraphs type configuration page

Plugins provided by

Paragraphs Collection

module

7 of 39

Style groups configuration

your_theme.paragraphs.style_group.yml

buttons:

label: 'Buttons'

8 of 39

Styles configuration

your_theme.paragraphs.style.yml

button-primary:

title: 'Primary'

classes:

- button--primary

groups:

- buttons

button-secondary:

title: 'Secondary'

classes:

- button--secondary

groups:

- buttons

9 of 39

Node edit form

10 of 39

Node edit form

11 of 39

Node view

12 of 39

2. How to reuse paragraphs and place them through a library?

13 of 39

Paragraphs library

14 of 39

Adding a new library item

15 of 39

Using a library item

16 of 39

Unlinking from library

17 of 39

Editing unlinked paragraphs

18 of 39

Promote to library

19 of 39

3. How to use Drag&Drop mode to

better organize my paragraphs?

20 of 39

Paragraphs ...

21 of 39

Default widget

22 of 39

Drag&Drop mode

23 of 39

4. How to organize my long

list of paragraphs types?

24 of 39

Add paragraph

25 of 39

Paragraph type configuration

3rd party settings

26 of 39

Add paragraph

27 of 39

5. How to extend paragraphs actions and convert one into a different type?

28 of 39

Alter paragraphs actions

/**

* Implements hook_paragraphs_widget_actions_alter().

*/

function paragraphs_test_paragraphs_widget_actions_alter(&$widget_actions, &$context) {

if (\Drupal::state()->get('paragraphs_test_dropbutton')) {

$widget_actions['dropdown_actions']['test_button'] = ParagraphsWidget::expandButton([

'#type' => 'submit',

'#value' => t('Convert'),

'#name' => 'field_paragraphs_test',

'#submit => 'paragraphs_test_conversion',

]);

}

}

29 of 39

Alter paragraphs actions

30 of 39

6. How to properly enable

Paragraphs translations?

31 of 39

Language settings (Content)

32 of 39

Language settings (Text paragraph)

33 of 39

Language settings (Container paragraph)

drupal.org/docs/8/modules/paragraphs/multilingual-paragraphs-configuration

34 of 39

7. How to configure Content Moderation workflow and Paragraphs?

35 of 39

Configure workflows

36 of 39

Configure workflows

37 of 39

Moderated content

38 of 39

Multilingual moderated content

drupal.org/docs/8/modules/paragraphs/multilingual-and-content-moderation

39 of 39

Q&A

Thank you!

Miloš Bovan �drupal.org/u/mbovan