Uncategorized

Set up Demo Site with Views and Content

To follow along with our Drupal Views tutorials, set up a Drupal site loaded with our 4 custom views and baseball stats content that will make querying in Views a bit more interesting and meaningful.

By the end of this tutorial, you should choose a solution and follow the instructions for creating a Drupal site loaded with our starting point content and views.

Goal

  • Set up a Drupal site with a starting point containing baseball stats content and 4 custom views.

Prerequisites

  • Ability/permissions to download software to your local machine.
  • To use DDEV, you should have DDEV installed (which has its own set of prerequisites, such as Docker). See DDEV Documentation and follow the installation instructions for your operating system. You should also be comfortable using the command line to navigate the file system and run commands. See Command Line Basics if needed.

No-install alternative

  • Feel free to use our Create a Sandbox button, which will create a Drupal application instance via Tugboat in a new browser window. Use it to walk-through the tutorials in this series. Learn more in this blog post: Sandboxes Now Available for Drupal Views Tutorials. (Note: the sandbox has been updated to Drupal 9.)

Recommendation: Use DDEV to install Drupal

We’ll use DDEV to install Drupal and import a database starting point that contains the content and views for our Views in Drupal tutorials. We’ve copied instructions from the Drupal Official Docs Local Development Guide in the following steps.

Exercise: Install Drupal with special content and configuration

Install DDEV

To use DDEV to install Drupal, you’ll need to install DDEV and its prerequisites, most importantly, Docker.

Go to the DDEV installation docs and follow the specific steps to install DDEV-Local for your computer’s operating system.

 

Create a new Drupal application

Choose a location for your local Drupal site, then run the following commands to create a new Drupal application via Composer. (Replace my-site-name with whatever you want to call your project directory). Or, use the ddev composer command if you don’t have Composer installed on your machine.

The export command is optional and makes it easier to copy and paste commands in this step and the next. You could skip the export line and replace $SITE_NAME with the name of your directory, i.e. my-site-name.

# Replace my-site-name!
export SITE_NAME=my-site-name
composer create-project drupal/recommended-project $SITE_NAME
cd $SITE_NAME

This will create a new directory and populate it with Drupal (and its dependencies).

 

Configure environment to serve your Drupal application

You now have a Drupal codebase. Next, you will need to configure your local development environment to serve that new codebase. At minimum, this requires creating a new database for Drupal and configuring the web server to serve Drupal content at a particular URL.

Run the following command (assumes DDEV):

ddev config --docroot web --project-name $SITE_NAME --project-type drupal9

Alternatively, type ddev config and it will walk you through the options, step-by-step.

This will configure your new Drupal application to work with DDEV and will store the generated configuration in a new .ddev subdirectory.

Next, start the DDEV container:

ddev start

You now have a web server and database server configured and running.

Read Comfy 1
Read Comfy 2
Read Comfy 3
Read Comfy 4
Read Comfy 5
Read Comfy 6
Read Comfy 7
Read Comfy 8
Read Comfy 9
Read Comfy 10
Read Comfy 11
Read Comfy 12
Read Comfy 13
Read Comfy 14
Read Comfy 15
Read Comfy 16
Read Comfy 17
Read Comfy 18
Read Comfy 19
Read Comfy 20
Read Comfy 21
Read Comfy 22
Read Comfy 23
Read Comfy 24
Read Comfy 25
Read Comfy 26
Read Comfy 27
Read Comfy 28
Read Comfy 29
Read Comfy 30
Read Comfy 31
Read Comfy 32
Read Comfy 33
Read Comfy 34
Read Comfy 35
Read Comfy 36
Read Comfy 37
Read Comfy 38
Read Comfy 39
Read Comfy 40
Read Comfy 41
Read Comfy 42
Read Comfy 43
Read Comfy 44
Read Comfy 45
Read Comfy 46
Read Comfy 47
Read Comfy 48
Read Comfy 49
Read Comfy 50
Read Comfy 51
Read Comfy 52
Read Comfy 53
Read Comfy 54
Read Comfy 55
Read Comfy 56
Read Comfy 57
Read Comfy 58
Read Comfy 59
Read Comfy 60
Read Comfy 61
Read Comfy 62
Read Comfy 63
Read Comfy 64
Read Comfy 65
Read Comfy 66
Read Comfy 67
Read Comfy 68
Read Comfy 69
Read Comfy 70
Read Comfy 71
Read Comfy 72
Read Comfy 73
Read Comfy 74
Read Comfy 75
Read Comfy 76
Read Comfy 77
Read Comfy 78
Read Comfy 79
Read Comfy 80
Read Comfy 81
Read Comfy 82
Read Comfy 83
Read Comfy 84
Read Comfy 85
Read Comfy 86
Read Comfy 87
Read Comfy 88
Read Comfy 89
Read Comfy 90
Read Comfy 91
Read Comfy 92
Read Comfy 93
Read Comfy 94
Read Comfy 95
Read Comfy 96
Read Comfy 97
Read Comfy 98
Read Comfy 99
Read Comfy 100
Read Comfy 101
Read Comfy 102
Read Comfy 103
Read Comfy 104
Read Comfy 105
Read Comfy 106
Read Comfy 107
Read Comfy 108
Read Comfy 109
Read Comfy 110
Read Comfy 111
Read Comfy 112
Read Comfy 113
Read Comfy 114
Read Comfy 115
Read Comfy 116
Read Comfy 117
Read Comfy 118
Read Comfy 119
Read Comfy 120
Read Comfy 121
Read Comfy 122
Read Comfy 123
Read Comfy 124
Read Comfy 125
Read Comfy 126
Read Comfy 127
Read Comfy 128
Read Comfy 129
Read Comfy 130
Read Comfy 131
Read Comfy 132
Read Comfy 133
Read Comfy 134
Read Comfy 135
Read Comfy 136
Read Comfy 137
Read Comfy 138
Read Comfy 139
Read Comfy 140
Read Comfy 141
Read Comfy 142
Read Comfy 143
Read Comfy 144
Read Comfy 145
Read Comfy 146
Read Comfy 147
Read Comfy 148
Read Comfy 149
Read Comfy 150
Read Comfy 151
Read Comfy 152
Read Comfy 153
Read Comfy 154
Read Comfy 155
Read Comfy 156
Read Comfy 157
Read Comfy 158
Read Comfy 159
Read Comfy 160
Read Comfy 161
Read Comfy 162
Read Comfy 163
Read Comfy 164
Read Comfy 165
Read Comfy 166
Read Comfy 167
Read Comfy 168
Read Comfy 169
Read Comfy 170
Read Comfy 171
Read Comfy 172
Read Comfy 173
Read Comfy 174
Read Comfy 175
Read Comfy 176
Read Comfy 177
Read Comfy 178
Read Comfy 179
Read Comfy 180
Read Comfy 181
Read Comfy 182
Read Comfy 183
Read Comfy 184
Read Comfy 185
Read Comfy 186
Read Comfy 187
Read Comfy 188
Read Comfy 189
Read Comfy 190
Read Comfy 191
Read Comfy 192
Read Comfy 193
Read Comfy 194
Read Comfy 195
Read Comfy 196
Read Comfy 197
Read Comfy 198
Read Comfy 199
Read Comfy 200
Read Comfy 201
Read Comfy 202
Read Comfy 203
Read Comfy 204
Read Comfy 205
Read Comfy 206
Read Comfy 207
Read Comfy 208
Read Comfy 209
Read Comfy 210
Read Comfy 211
Read Comfy 212
Read Comfy 213
Read Comfy 214
Read Comfy 215
Read Comfy 216
Read Comfy 217
Read Comfy 218
Read Comfy 219
Read Comfy 220
Read Comfy 221
Read Comfy 222
Read Comfy 223
Read Comfy 224
Read Comfy 225
Read Comfy 226
Read Comfy 227
Read Comfy 228
Read Comfy 229
Read Comfy 230
Read Comfy 231
Read Comfy 232
Read Comfy 233
Read Comfy 234
Read Comfy 235
Read Comfy 236
Read Comfy 237
Read Comfy 238
Read Comfy 239
Read Comfy 240
Read Comfy 241
Read Comfy 242
Read Comfy 243
Read Comfy 244
Read Comfy 245
Read Comfy 246
Read Comfy 247
Read Comfy 248
Read Comfy 249
Read Comfy 250
Read Comfy 251
Read Comfy 252
Read Comfy 253
Read Comfy 254
Read Comfy 255
Read Comfy 256
Read Comfy 257
Read Comfy 258
Read Comfy 259
Read Comfy 260
Read Comfy 261
Read Comfy 262
Read Comfy 263
Read Comfy 264
Read Comfy 265
Read Comfy 266
Read Comfy 267
Read Comfy 268
Read Comfy 269
Read Comfy 270
Read Comfy 271
Read Comfy 272
Read Comfy 273
Read Comfy 274
Read Comfy 275
Read Comfy 276
Read Comfy 277
Read Comfy 278
Read Comfy 279
Read Comfy 280
Read Comfy 281
Read Comfy 282
Read Comfy 283
Read Comfy 284
Read Comfy 285
Read Comfy 286
Read Comfy 287
Read Comfy 288
Read Comfy 289
Read Comfy 290
Read Comfy 291
Read Comfy 292
Read Comfy 293
Read Comfy 294
Read Comfy 295
Read Comfy 296
Read Comfy 297
Read Comfy 298
Read Comfy 299
Read Comfy 300
Read Comfy 301
Read Comfy 302
Read Comfy 303
Read Comfy 304
Read Comfy 305
Read Comfy 306
Read Comfy 307
Read Comfy 308
Read Comfy 309
Read Comfy 310
Read Comfy 311
Read Comfy 312
Read Comfy 313
Read Comfy 314
Read Comfy 315
Read Comfy 316
Read Comfy 317
Read Comfy 318
Read Comfy 319
Read Comfy 320
Read Comfy 321
Read Comfy 322
Read Comfy 323
Read Comfy 324
Read Comfy 325
Read Comfy 326
Read Comfy 327
Read Comfy 328
Read Comfy 329
Read Comfy 330
Read Comfy 331
Read Comfy 332
Read Comfy 333
Read Comfy 334
Read Comfy 335
Read Comfy 336
Read Comfy 337
Read Comfy 338
Read Comfy 339
Read Comfy 340
Read Comfy 341
Read Comfy 342
Read Comfy 343
Read Comfy 344
Read Comfy 345
Read Comfy 346
Read Comfy 347
Read Comfy 348
Read Comfy 349
Read Comfy 350
Read Comfy 351
Read Comfy 352
Read Comfy 353
Read Comfy 354
Read Comfy 355
Read Comfy 356
Read Comfy 357
Read Comfy 358
Read Comfy 359
Read Comfy 360
Read Comfy 361
Read Comfy 362
Read Comfy 363
Read Comfy 364
Read Comfy 365
Read Comfy 366
Read Comfy 367
Read Comfy 368
Read Comfy 369
Read Comfy 370
Read Comfy 371
Read Comfy 372
Read Comfy 373
Read Comfy 374
Read Comfy 375
Read Comfy 376
Read Comfy 377
Read Comfy 378
Read Comfy 379
Read Comfy 380
Read Comfy 381
Read Comfy 382
Read Comfy 383
Read Comfy 384
Read Comfy 385
Read Comfy 386
Read Comfy 387
Read Comfy 388
Read Comfy 389
Read Comfy 390
Read Comfy 391
Read Comfy 392
Read Comfy 393
Read Comfy 394
Read Comfy 395
Read Comfy 396
Read Comfy 397
Read Comfy 398
Read Comfy 399
Read Comfy 400
Read Comfy 401
Read Comfy 402
Read Comfy 403
Read Comfy 404
Read Comfy 405
Read Comfy 406
Read Comfy 407
Read Comfy 408
Read Comfy 409
Read Comfy 410
Read Comfy 411
Read Comfy 412
Read Comfy 413
Read Comfy 414
Read Comfy 415
Read Comfy 416
Read Comfy 417
Read Comfy 418
Read Comfy 419
Read Comfy 420
Read Comfy 421
Read Comfy 422
Read Comfy 423
Read Comfy 424
Read Comfy 425
Read Comfy 426
Read Comfy 427
Read Comfy 428
Read Comfy 429
Read Comfy 430
Read Comfy 431
Read Comfy 432
Read Comfy 433
Read Comfy 434
Read Comfy 435
Read Comfy 436
Read Comfy 437
Read Comfy 438
Read Comfy 439
Read Comfy 440
Read Comfy 441
Read Comfy 442
Read Comfy 443
Read Comfy 444
Read Comfy 445
Read Comfy 446
Read Comfy 447
Read Comfy 448
Read Comfy 449
Read Comfy 450
Read Comfy 451
Read Comfy 452
Read Comfy 453
Read Comfy 454
Read Comfy 455
Read Comfy 456
Read Comfy 457
Read Comfy 458
Read Comfy 459
Read Comfy 460
Read Comfy 461
Read Comfy 462
Read Comfy 463
Read Comfy 464
Read Comfy 465
Read Comfy 466
Read Comfy 467
Read Comfy 468
Read Comfy 469
Read Comfy 470
Read Comfy 471
Read Comfy 472
Read Comfy 473
Read Comfy 474
Read Comfy 475
Read Comfy 476
Read Comfy 477
Read Comfy 478
Read Comfy 479
Read Comfy 480
Read Comfy 481
Read Comfy 482
Read Comfy 483
Read Comfy 484
Read Comfy 485
Read Comfy 486
Read Comfy 487
Read Comfy 488
Read Comfy 489
Read Comfy 490
Read Comfy 491
Read Comfy 492
Read Comfy 493
Read Comfy 494
Read Comfy 495
Read Comfy 496
Read Comfy 497
Read Comfy 498
Read Comfy 499
Read Comfy 500

Related Articles

Leave a Reply

Back to top button