paragraphs without pain (content strategy for drupal paragraphs)

50
Paragraphs without pain Angus Gordon Weave (weaveweb.com.au)

Upload: angus-gordon

Post on 07-Jan-2017

260 views

Category:

Internet


3 download

TRANSCRIPT

Page 1: Paragraphs without pain (content strategy for Drupal Paragraphs)

Paragraphs without pain

Angus GordonWeave (weaveweb.com.au)

Page 2: Paragraphs without pain (content strategy for Drupal Paragraphs)

This talk

● What is Paragraphs, and what is it good for?● What are the ways Paragraphs can go wrong, and how

can I avoid them?

Page 3: Paragraphs without pain (content strategy for Drupal Paragraphs)

What is Paragraphs and what is it good for?

Page 4: Paragraphs without pain (content strategy for Drupal Paragraphs)

Traditional content modelling in Drupal

● Content types● Fields● Taxonomy● Entity references● Views

Page 5: Paragraphs without pain (content strategy for Drupal Paragraphs)

This is great for capturing content that follows set patterns.

Page 6: Paragraphs without pain (content strategy for Drupal Paragraphs)

But not all content does that:

Page 7: Paragraphs without pain (content strategy for Drupal Paragraphs)

Landing pagesHome pagesLongform articlesMultipart content

Page 8: Paragraphs without pain (content strategy for Drupal Paragraphs)

Typical Drupal solutions

● Layout in the Body field● Big bunch o’ blocks● Panels

Page 9: Paragraphs without pain (content strategy for Drupal Paragraphs)
Page 10: Paragraphs without pain (content strategy for Drupal Paragraphs)

...but none of them are good solutions for flexible structures like these

Page 11: Paragraphs without pain (content strategy for Drupal Paragraphs)

Enter Paragraphsdrupal.org/project/paragraphs

Page 12: Paragraphs without pain (content strategy for Drupal Paragraphs)

What is Paragraphs?

● An entity type designed to be created and embedded inside other entities

● Like constructing content from building blocks

Page 13: Paragraphs without pain (content strategy for Drupal Paragraphs)

Basic Paragraphs implementation

● Create “Paragraph types” (“Paragraph bundles” in earlier versions) for each type of building block you need (equivalent to content types)

● Add a Paragraphs field to your “host” entity● Make it a multi-value field so authors can add any

number of Paragraphs, of any type, in any order

Page 14: Paragraphs without pain (content strategy for Drupal Paragraphs)

Examples

http://paragraphs.site-showcase.com/ (Morpht)

https://www.communications.gov.au/ (Acquia/PNX)

https://www.ewov.com.au/reports/res-online/201609 (Weave)

Page 15: Paragraphs without pain (content strategy for Drupal Paragraphs)

Alternatives?

Page 16: Paragraphs without pain (content strategy for Drupal Paragraphs)

Inline Entity Form + Nodes or custom entities● See

https://www.chapterthree.com/blog/paragraphs-vs-eck-drupal-8

● This is the approach to go for if you need your individual entities to be reusable or to exist independently of the “host” entity

● Advantages of Paragraphs: lightweight, works out of the box, ecosystem

Page 17: Paragraphs without pain (content strategy for Drupal Paragraphs)

WYSIWYG Fields or Entity Embed

● https://www.drupal.org/project/wysiwyg_fields● https://www.drupal.org/project/entity_embed ● Both ways of inserting a component (either a field or an

entity) into a Body field using WYSIWYG● Great for particular use cases (e.g. longform articles with

rich media)● Both can be used in conjunction with Paragraphs

Page 18: Paragraphs without pain (content strategy for Drupal Paragraphs)

Ways Paragraphs can go wrong...and how to avoid

them?

Page 19: Paragraphs without pain (content strategy for Drupal Paragraphs)
Page 20: Paragraphs without pain (content strategy for Drupal Paragraphs)

Drupal people have learned how to do content modelling for content types.

Page 21: Paragraphs without pain (content strategy for Drupal Paragraphs)

Do we have to re-learn these principles for Paragraphs?

Page 22: Paragraphs without pain (content strategy for Drupal Paragraphs)

Ways Paragraphs can go wrong

● Poor naming● Lack of planning● Mixing content and presentation● Editing interface issues● Excessive complexity

Page 23: Paragraphs without pain (content strategy for Drupal Paragraphs)

Poor naming

Page 24: Paragraphs without pain (content strategy for Drupal Paragraphs)

The name “Paragraphs”

● Let’s be honest, it’s a terrible name● We already have 2 things called paragraphs: an HTML

element and a unit of language● If we can’t change the name of the module, let’s at least

hide it from authors

Page 25: Paragraphs without pain (content strategy for Drupal Paragraphs)

You can choose how Paragraphs will be labelled in the editing interface!

Page 26: Paragraphs without pain (content strategy for Drupal Paragraphs)

Naming of Paragraph types

● Confusing● Ad hoc● Coupled to presentation

These problems are related to other issues: lack of planning and mixing content and presentation.

Page 27: Paragraphs without pain (content strategy for Drupal Paragraphs)

Lack of planning

Page 28: Paragraphs without pain (content strategy for Drupal Paragraphs)

Creating a new Paragraph type whenever you need oneParagraphs seems to invite this ad hoc approach

This can lead to

● Too many types invented for a single use case● Too many similar-sounding names● Lack of discipline● Complexity

Page 29: Paragraphs without pain (content strategy for Drupal Paragraphs)

Solution: plan that shit

● Plan Paragraphs bundles the same way you plan content types

● You do plan content types, right?● Include Paragraphs requirements in content audit and

content model● Put some guidelines in place for creating new Paragraphs

types: make them “earn their place”

Page 30: Paragraphs without pain (content strategy for Drupal Paragraphs)

Mixing content and presentation

Page 31: Paragraphs without pain (content strategy for Drupal Paragraphs)

Entities are not pages

● Basic content modelling concept: separate content from presentation

● Becomes more urgent as we move towards decoupled / headless sites

● If we take this principle seriously, we will think of Paragraph types as semantic structures not mini-layouts

Page 32: Paragraphs without pain (content strategy for Drupal Paragraphs)

Solution: think decoupled

● Avoid presentational logic when naming Paragraphs bundles and fields

● “Three column promo grid” => “Three item promo section”

● “Text beneath image” => “Text associated with image”● “Blue background text box” => “Highlighted text box”

Page 33: Paragraphs without pain (content strategy for Drupal Paragraphs)

Editing interface issues

Page 34: Paragraphs without pain (content strategy for Drupal Paragraphs)

You can choose how Paragraphs will be displayed in the editing interface

Page 35: Paragraphs without pain (content strategy for Drupal Paragraphs)

This is “Open”.

Page 36: Paragraphs without pain (content strategy for Drupal Paragraphs)

This is “Closed”.

Page 37: Paragraphs without pain (content strategy for Drupal Paragraphs)

This is “Preview”. Nifty! But how…?

Page 38: Paragraphs without pain (content strategy for Drupal Paragraphs)

Custom view mode for each Paragraph type

Page 39: Paragraphs without pain (content strategy for Drupal Paragraphs)

Choose the field you want to display in the editing interface.

Page 40: Paragraphs without pain (content strategy for Drupal Paragraphs)

Enable “Preview” Edit mode

Page 41: Paragraphs without pain (content strategy for Drupal Paragraphs)

Is Paragraphs even the right tool?

● Paragraphs works well where content is intrinsically chunky

● What about long form articles that are “punctuated” by rich media?

● This is a single narrative (“body”) with interruptions, not a series of discrete chunks

● WYSIWYG Fields or Entity Embed might be the solution: perhaps in combination with Paragraphs

Page 42: Paragraphs without pain (content strategy for Drupal Paragraphs)

Excessive complexity

Page 43: Paragraphs without pain (content strategy for Drupal Paragraphs)

Possibilities for excessive complexity

● Too many similar paragraph bundles (already discussed)● Too many levels of nesting (Paragraphs within

Paragraphs within Paragraphs)

Page 44: Paragraphs without pain (content strategy for Drupal Paragraphs)
Page 45: Paragraphs without pain (content strategy for Drupal Paragraphs)
Page 46: Paragraphs without pain (content strategy for Drupal Paragraphs)

LImit Paragraph types allowed to avoid infinite nesting

Page 47: Paragraphs without pain (content strategy for Drupal Paragraphs)

The Drupal community is taking author experience seriously.

Page 48: Paragraphs without pain (content strategy for Drupal Paragraphs)
Page 49: Paragraphs without pain (content strategy for Drupal Paragraphs)

Let’s make Paragraphs part of that.

Page 50: Paragraphs without pain (content strategy for Drupal Paragraphs)

Thank you!

@angusgmelb@WeAreWeave