Want to learn more about Paragraphs? Then check out our online video course called “Build Edge-to-edge Sites using Paragraphs in Drupal 8“.
Over the last couple of years edge-to-edge, or fluid looking websites, have become popular. You just have to look at a few digital agency websites and you’ll notice the common pattern.
With this design, the page is broken out into separate components. A component could be something as simple as a single text field, or something complex like an image gallery. You may also see scrolling animation on these components. As a user scrolls the text could zoom in from the right and an image could fade in from the left.
How would you build this type of website in Drupal?
Let me introduce you to Paragraphs.
The module allows you to build Paragraph types which an editor can then add to a page using a Paragraph field.
On a decent size website, you could have a few paragraph types: one for entering in text and another to display content in a grid, or another which displays a video.
In this tutorial, you’ll learn the basics of Paragraphs and we’ll setup a simple paragraph type for adding basic text.
In future tutorials, we’ll look at using Paragraphs to manage a dynamic sidebar and how to create an image gallery.
We have a lot to do, so let’s jump right in.
Getting Started
Before we begin, download and install Paragraphs and Entity Reference Revisions.
Below are the Drush and Drupal Console commands to download and install:
Drush:
$ drush dl paragraphs entity_reference_revisions $ drush en paragraphs
Drupal Console:
$ drupal module:download paragraphs 8.x-1.0-rc4 $ drupal module:download entity_reference_revisions 8.x-1.0-rc4 $ drupal module:install paragraphs
Creating Paragraph Type
When creating a paragraph-powered website the first thing you need to do is look at the designs and look out for common patterns.
For example, there may be a need to display an image and text side-by-side in a grid, or testimonials may need to be displayed. These two examples are perfect candidates for their own paragraph type.
For this tutorial, we’ll create a basic Content paragraph type which’ll have just two fields: Title (text field) and Content (textarea).
1. On the navigation bar click on Structure and “Paragraphs types”.
From this page you can create new paragraph types and you’ll be able to manage existing ones. Currently, there are none, so you can’t see any.
2. Click on “Add a Paragraphs type”.
3. Enter Content into the Label and make sure the machine name is content
. Then click on Save.
4. Now you should be back on the “Paragraphs types” page and you should see the new Content paragraph type which we just created.
If you click on the Edit button down arrow, in the Operations column, you should see a bunch of options such as “Manage fields” and “Manage displays”.
If you know how to add fields to content types or other entities than this should look familiar. Managing fields on a paragraph type is the same as on content types and other entities.
Click Here 1
Click Here 2
Click Here 3
Click Here 4
Click Here 5
Click Here 6
Click Here 7
Click Here 8
Click Here 9
Click Here 10
Click Here 11
Click Here 12
Click Here 13
Click Here 14
Click Here 15
Click Here 16
Click Here 17
Click Here 18
Click Here 19
Click Here 20
Click Here 21
Click Here 22
Click Here 23
Click Here 24
Click Here 25
Click Here 26
Click Here 27
Click Here 28
Click Here 29
Click Here 30
Click Here 31
Click Here 32
Click Here 33
Click Here 34
Click Here 35
Click Here 36
Click Here 37
Click Here 38
Click Here 39
Click Here 40
Click Here 41
Click Here 42
Click Here 43
Click Here 44
Click Here 45
Click Here 46
Click Here 47
Click Here 48
Click Here 49
Click Here 50
Click Here 51
Click Here 52
Click Here 53
Click Here 54
Click Here 55
Click Here 56
Click Here 57
Click Here 58
Click Here 59
Click Here 60
Click Here 61
Click Here 62
Click Here 63
Click Here 64
Click Here 65
Click Here 66
Click Here 67
Click Here 68
Click Here 69
Click Here 70
Click Here 71
Click Here 72
Click Here 73
Click Here 74
Click Here 75
Click Here 76
Click Here 77
Click Here 78
Click Here 79
Click Here 80
Click Here 81
Click Here 82
Click Here 83
Click Here 84
Click Here 85
Click Here 86
Click Here 87
Click Here 88
Click Here 89
Click Here 90
Click Here 91
Click Here 92
Click Here 93
Click Here 94
Click Here 95
Click Here 96
Click Here 97
Click Here 98
Click Here 99
Click Here 100
Click Here 101
Click Here 102
Click Here 103
Click Here 104
Click Here 105
Click Here 106
Click Here 107
Click Here 108
Click Here 109
Click Here 110
Click Here 111
Click Here 112
Click Here 113
Click Here 114
Click Here 115
Click Here 116
Click Here 117
Click Here 118
Click Here 119
Click Here 120
Click Here 121
Click Here 122
Click Here 123
Click Here 124
Click Here 125
Click Here 126
Click Here 127
Click Here 128
Click Here 129
Click Here 130
Click Here 131
Click Here 132
Click Here 133
Click Here 134
Click Here 135
Click Here 136
Click Here 137
Click Here 138
Click Here 139
Click Here 140
Click Here 141
Click Here 142
Click Here 143
Click Here 144
Click Here 145
Click Here 146
Click Here 147
Click Here 148
Click Here 149
Click Here 150
Click Here 151
Click Here 152
Click Here 153
Click Here 154
Click Here 155
Click Here 156
Click Here 157
Click Here 158
Click Here 159
Click Here 160
Click Here 161
Click Here 162
Click Here 163
Click Here 164
Click Here 165
Click Here 166
Click Here 167
Click Here 168
Click Here 169
Click Here 170
Click Here 171
Click Here 172
Click Here 173
Click Here 174
Click Here 175
Click Here 176
Click Here 177
Click Here 178
Click Here 179
Click Here 180
Click Here 181
Click Here 182
Click Here 183
Click Here 184
Click Here 185
Click Here 186
Click Here 187
Click Here 188
Click Here 189
Click Here 190
Click Here 191
Click Here 192
Click Here 193
Click Here 194
Click Here 195
Click Here 196
Click Here 197
Click Here 198
Click Here 199
Click Here 200
Click Here 201
Click Here 202
Click Here 203
Click Here 204
Click Here 205
Click Here 206
Click Here 207
Click Here 208
Click Here 209
Click Here 210
Click Here 211
Click Here 212
Click Here 213
Click Here 214
Click Here 215
Click Here 216
Click Here 217
Click Here 218
Click Here 219
Click Here 220
Click Here 221
Click Here 222
Click Here 223
Click Here 224
Click Here 225
Click Here 226
Click Here 227
Click Here 228
Click Here 229
Click Here 230
Click Here 231
Click Here 232
Click Here 233
Click Here 234
Click Here 235
Click Here 236
Click Here 237
Click Here 238
Click Here 239
Click Here 240
Click Here 241
Click Here 242
Click Here 243
Click Here 244
Click Here 245
Click Here 246
Click Here 247
Click Here 248
Click Here 249
Click Here 250
Click Here 251
Click Here 252
Click Here 253
Click Here 254
Click Here 255
Click Here 256
Click Here 257
Click Here 258
Click Here 259
Click Here 260
Click Here 261
Click Here 262
Click Here 263
Click Here 264
Click Here 265
Click Here 266
Click Here 267
Click Here 268
Click Here 269
Click Here 270
Click Here 271
Click Here 272
Click Here 273
Click Here 274
Click Here 275
Click Here 276
Click Here 277
Click Here 278
Click Here 279
Click Here 280
Click Here 281
Click Here 282
Click Here 283
Click Here 284
Click Here 285
Click Here 286
Click Here 287
Click Here 288
Click Here 289
Click Here 290
Click Here 291
Click Here 292
Click Here 293
Click Here 294
Click Here 295
Click Here 296
Click Here 297
Click Here 298
Click Here 299
Click Here 300
Click Here 301
Click Here 302
Click Here 303
Click Here 304
Click Here 305
Click Here 306
Click Here 307
Click Here 308
Click Here 309
Click Here 310
Click Here 311
Click Here 312
Click Here 313
Click Here 314
Click Here 315
Click Here 316
Click Here 317
Click Here 318
Click Here 319
Click Here 320
Click Here 321
Click Here 322
Click Here 323
Click Here 324
Click Here 325
Click Here 326
Click Here 327
Click Here 328
Click Here 329
Click Here 330
Click Here 331
Click Here 332
Click Here 333
Click Here 334
Click Here 335
Click Here 336
Click Here 337
Click Here 338
Click Here 339
Click Here 340
Click Here 341
Click Here 342
Click Here 343
Click Here 344
Click Here 345
Click Here 346
Click Here 347
Click Here 348
Click Here 349
Click Here 350
Click Here 351
Click Here 352
Click Here 353
Click Here 354
Click Here 355
Click Here 356
Click Here 357
Click Here 358
Click Here 359
Click Here 360
Click Here 361
Click Here 362
Click Here 363
Click Here 364
Click Here 365
Click Here 366
Click Here 367
Click Here 368
Click Here 369
Click Here 370
Click Here 371
Click Here 372
Click Here 373
Click Here 374
Click Here 375
Click Here 376
Click Here 377
Click Here 378
Click Here 379
Click Here 380
Click Here 381
Click Here 382
Click Here 383
Click Here 384
Click Here 385
Click Here 386
Click Here 387
Click Here 388
Click Here 389
Click Here 390
Click Here 391
Click Here 392
Click Here 393
Click Here 394
Click Here 395
Click Here 396
Click Here 397
Click Here 398
Click Here 399
Click Here 400
Click Here 401
Click Here 402
Click Here 403
Click Here 404
Click Here 405
Click Here 406
Click Here 407
Click Here 408
Click Here 409
Click Here 410
Click Here 411
Click Here 412
Click Here 413
Click Here 414
Click Here 415
Click Here 416
Click Here 417
Click Here 418
Click Here 419
Click Here 420
Click Here 421
Click Here 422
Click Here 423
Click Here 424
Click Here 425
Click Here 426
Click Here 427
Click Here 428
Click Here 429
Click Here 430
Click Here 431
Click Here 432
Click Here 433
Click Here 434
Click Here 435
Click Here 436
Click Here 437
Click Here 438
Click Here 439
Click Here 440
Click Here 441
Click Here 442
Click Here 443
Click Here 444
Click Here 445
Click Here 446
Click Here 447
Click Here 448
Click Here 449
Click Here 450
Click Here 451
Click Here 452
Click Here 453
Click Here 454
Click Here 455
Click Here 456
Click Here 457
Click Here 458
Click Here 459
Click Here 460
Click Here 461
Click Here 462
Click Here 463
Click Here 464
Click Here 465
Click Here 466
Click Here 467
Click Here 468
Click Here 469
Click Here 470
Click Here 471
Click Here 472
Click Here 473
Click Here 474
Click Here 475
Click Here 476
Click Here 477
Click Here 478
Click Here 479
Click Here 480
Click Here 481
Click Here 482
Click Here 483
Click Here 484
Click Here 485
Click Here 486
Click Here 487
Click Here 488
Click Here 489
Click Here 490
Click Here 491
Click Here 492
Click Here 493
Click Here 494
Click Here 495
Click Here 496
Click Here 497
Click Here 498
Click Here 499
Click Here 500