Uncategorized

Set up Demo Site for Theming Practice

Set up a local development environment to practice Drupal theme development. In order to practice theme development, either on your own or following our Hands-On: Theming guide, you’ll need a Drupal site up and running on your computer.

By the end of this tutorial, you should be able to:

  • Install Drupal on your computer so you can modify files with a code editor of your choice.
  • Generate dummy content so that you have different kinds of pages to theme.

Goal

Set up a local development environment with Drupal installed and dummy content generated so that there are real pages on your site for you to theme.

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.

Recommendation: Use DDEV to install Drupal

We’ll use DDEV to install Drupal. We’ve copied instructions from the Drupal Official Docs Local Development Guide in the following steps.

Exercise: Install Drupal and generate dummy content

Install DDEV

Note: This tutorial assumes you’re using ddev version 1.14.0 or greater.

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.

 

 

Configure environment to serve your Drupal application

First you will need to configure your local development environment to serve a Drupal 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):

# Replace my-site-name!
export SITE_NAME=my-site-name
mkdir $SITE_NAME
cd $SITE_NAME

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

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.

 

 

Create a new Drupal application

Next we’ll install Drupal 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.

# Install latest version of Drupal.
ddev composer create "drupal/recommended-project"
# Or alternatively, install Drupal 8.
# ddev composer create "drupal/recommended-project:^8"
ddev composer require drush/drush

We’re also downloading Drush in this step. We’ll use Drush in a moment to enable modules and generate content.

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

Read Comfy 2501
Read Comfy 2502
Read Comfy 2503
Read Comfy 2504
Read Comfy 2505
Read Comfy 2506
Read Comfy 2507
Read Comfy 2508
Read Comfy 2509
Read Comfy 2510
Read Comfy 2511
Read Comfy 2512
Read Comfy 2513
Read Comfy 2514
Read Comfy 2515
Read Comfy 2516
Read Comfy 2517
Read Comfy 2518
Read Comfy 2519
Read Comfy 2520
Read Comfy 2521
Read Comfy 2522
Read Comfy 2523
Read Comfy 2524
Read Comfy 2525
Read Comfy 2526
Read Comfy 2527
Read Comfy 2528
Read Comfy 2529
Read Comfy 2530
Read Comfy 2531
Read Comfy 2532
Read Comfy 2533
Read Comfy 2534
Read Comfy 2535
Read Comfy 2536
Read Comfy 2537
Read Comfy 2538
Read Comfy 2539
Read Comfy 2540
Read Comfy 2541
Read Comfy 2542
Read Comfy 2543
Read Comfy 2544
Read Comfy 2545
Read Comfy 2546
Read Comfy 2547
Read Comfy 2548
Read Comfy 2549
Read Comfy 2550
Read Comfy 2551
Read Comfy 2552
Read Comfy 2553
Read Comfy 2554
Read Comfy 2555
Read Comfy 2556
Read Comfy 2557
Read Comfy 2558
Read Comfy 2559
Read Comfy 2560
Read Comfy 2561
Read Comfy 2562
Read Comfy 2563
Read Comfy 2564
Read Comfy 2565
Read Comfy 2566
Read Comfy 2567
Read Comfy 2568
Read Comfy 2569
Read Comfy 2570
Read Comfy 2571
Read Comfy 2572
Read Comfy 2573
Read Comfy 2574
Read Comfy 2575
Read Comfy 2576
Read Comfy 2577
Read Comfy 2578
Read Comfy 2579
Read Comfy 2580
Read Comfy 2581
Read Comfy 2582
Read Comfy 2583
Read Comfy 2584
Read Comfy 2585
Read Comfy 2586
Read Comfy 2587
Read Comfy 2588
Read Comfy 2589
Read Comfy 2590
Read Comfy 2591
Read Comfy 2592
Read Comfy 2593
Read Comfy 2594
Read Comfy 2595
Read Comfy 2596
Read Comfy 2597
Read Comfy 2598
Read Comfy 2599
Read Comfy 2600
Read Comfy 2601
Read Comfy 2602
Read Comfy 2603
Read Comfy 2604
Read Comfy 2605
Read Comfy 2606
Read Comfy 2607
Read Comfy 2608
Read Comfy 2609
Read Comfy 2610
Read Comfy 2611
Read Comfy 2612
Read Comfy 2613
Read Comfy 2614
Read Comfy 2615
Read Comfy 2616
Read Comfy 2617
Read Comfy 2618
Read Comfy 2619
Read Comfy 2620
Read Comfy 2621
Read Comfy 2622
Read Comfy 2623
Read Comfy 2624
Read Comfy 2625
Read Comfy 2626
Read Comfy 2627
Read Comfy 2628
Read Comfy 2629
Read Comfy 2630
Read Comfy 2631
Read Comfy 2632
Read Comfy 2633
Read Comfy 2634
Read Comfy 2635
Read Comfy 2636
Read Comfy 2637
Read Comfy 2638
Read Comfy 2639
Read Comfy 2640
Read Comfy 2641
Read Comfy 2642
Read Comfy 2643
Read Comfy 2644
Read Comfy 2645
Read Comfy 2646
Read Comfy 2647
Read Comfy 2648
Read Comfy 2649
Read Comfy 2650
Read Comfy 2651
Read Comfy 2652
Read Comfy 2653
Read Comfy 2654
Read Comfy 2655
Read Comfy 2656
Read Comfy 2657
Read Comfy 2658
Read Comfy 2659
Read Comfy 2660
Read Comfy 2661
Read Comfy 2662
Read Comfy 2663
Read Comfy 2664
Read Comfy 2665
Read Comfy 2666
Read Comfy 2667
Read Comfy 2668
Read Comfy 2669
Read Comfy 2670
Read Comfy 2671
Read Comfy 2672
Read Comfy 2673
Read Comfy 2674
Read Comfy 2675
Read Comfy 2676
Read Comfy 2677
Read Comfy 2678
Read Comfy 2679
Read Comfy 2680
Read Comfy 2681
Read Comfy 2682
Read Comfy 2683
Read Comfy 2684
Read Comfy 2685
Read Comfy 2686
Read Comfy 2687
Read Comfy 2688
Read Comfy 2689
Read Comfy 2690
Read Comfy 2691
Read Comfy 2692
Read Comfy 2693
Read Comfy 2694
Read Comfy 2695
Read Comfy 2696
Read Comfy 2697
Read Comfy 2698
Read Comfy 2699
Read Comfy 2700
Read Comfy 2701
Read Comfy 2702
Read Comfy 2703
Read Comfy 2704
Read Comfy 2705
Read Comfy 2706
Read Comfy 2707
Read Comfy 2708
Read Comfy 2709
Read Comfy 2710
Read Comfy 2711
Read Comfy 2712
Read Comfy 2713
Read Comfy 2714
Read Comfy 2715
Read Comfy 2716
Read Comfy 2717
Read Comfy 2718
Read Comfy 2719
Read Comfy 2720
Read Comfy 2721
Read Comfy 2722
Read Comfy 2723
Read Comfy 2724
Read Comfy 2725
Read Comfy 2726
Read Comfy 2727
Read Comfy 2728
Read Comfy 2729
Read Comfy 2730
Read Comfy 2731
Read Comfy 2732
Read Comfy 2733
Read Comfy 2734
Read Comfy 2735
Read Comfy 2736
Read Comfy 2737
Read Comfy 2738
Read Comfy 2739
Read Comfy 2740
Read Comfy 2741
Read Comfy 2742
Read Comfy 2743
Read Comfy 2744
Read Comfy 2745
Read Comfy 2746
Read Comfy 2747
Read Comfy 2748
Read Comfy 2749
Read Comfy 2750
Read Comfy 2751
Read Comfy 2752
Read Comfy 2753
Read Comfy 2754
Read Comfy 2755
Read Comfy 2756
Read Comfy 2757
Read Comfy 2758
Read Comfy 2759
Read Comfy 2760
Read Comfy 2761
Read Comfy 2762
Read Comfy 2763
Read Comfy 2764
Read Comfy 2765
Read Comfy 2766
Read Comfy 2767
Read Comfy 2768
Read Comfy 2769
Read Comfy 2770
Read Comfy 2771
Read Comfy 2772
Read Comfy 2773
Read Comfy 2774
Read Comfy 2775
Read Comfy 2776
Read Comfy 2777
Read Comfy 2778
Read Comfy 2779
Read Comfy 2780
Read Comfy 2781
Read Comfy 2782
Read Comfy 2783
Read Comfy 2784
Read Comfy 2785
Read Comfy 2786
Read Comfy 2787
Read Comfy 2788
Read Comfy 2789
Read Comfy 2790
Read Comfy 2791
Read Comfy 2792
Read Comfy 2793
Read Comfy 2794
Read Comfy 2795
Read Comfy 2796
Read Comfy 2797
Read Comfy 2798
Read Comfy 2799
Read Comfy 2800
Read Comfy 2801
Read Comfy 2802
Read Comfy 2803
Read Comfy 2804
Read Comfy 2805
Read Comfy 2806
Read Comfy 2807
Read Comfy 2808
Read Comfy 2809
Read Comfy 2810
Read Comfy 2811
Read Comfy 2812
Read Comfy 2813
Read Comfy 2814
Read Comfy 2815
Read Comfy 2816
Read Comfy 2817
Read Comfy 2818
Read Comfy 2819
Read Comfy 2820
Read Comfy 2821
Read Comfy 2822
Read Comfy 2823
Read Comfy 2824
Read Comfy 2825
Read Comfy 2826
Read Comfy 2827
Read Comfy 2828
Read Comfy 2829
Read Comfy 2830
Read Comfy 2831
Read Comfy 2832
Read Comfy 2833
Read Comfy 2834
Read Comfy 2835
Read Comfy 2836
Read Comfy 2837
Read Comfy 2838
Read Comfy 2839
Read Comfy 2840
Read Comfy 2841
Read Comfy 2842
Read Comfy 2843
Read Comfy 2844
Read Comfy 2845
Read Comfy 2846
Read Comfy 2847
Read Comfy 2848
Read Comfy 2849
Read Comfy 2850
Read Comfy 2851
Read Comfy 2852
Read Comfy 2853
Read Comfy 2854
Read Comfy 2855
Read Comfy 2856
Read Comfy 2857
Read Comfy 2858
Read Comfy 2859
Read Comfy 2860
Read Comfy 2861
Read Comfy 2862
Read Comfy 2863
Read Comfy 2864
Read Comfy 2865
Read Comfy 2866
Read Comfy 2867
Read Comfy 2868
Read Comfy 2869
Read Comfy 2870
Read Comfy 2871
Read Comfy 2872
Read Comfy 2873
Read Comfy 2874
Read Comfy 2875
Read Comfy 2876
Read Comfy 2877
Read Comfy 2878
Read Comfy 2879
Read Comfy 2880
Read Comfy 2881
Read Comfy 2882
Read Comfy 2883
Read Comfy 2884
Read Comfy 2885
Read Comfy 2886
Read Comfy 2887
Read Comfy 2888
Read Comfy 2889
Read Comfy 2890
Read Comfy 2891
Read Comfy 2892
Read Comfy 2893
Read Comfy 2894
Read Comfy 2895
Read Comfy 2896
Read Comfy 2897
Read Comfy 2898
Read Comfy 2899
Read Comfy 2900
Read Comfy 2901
Read Comfy 2902
Read Comfy 2903
Read Comfy 2904
Read Comfy 2905
Read Comfy 2906
Read Comfy 2907
Read Comfy 2908
Read Comfy 2909
Read Comfy 2910
Read Comfy 2911
Read Comfy 2912
Read Comfy 2913
Read Comfy 2914
Read Comfy 2915
Read Comfy 2916
Read Comfy 2917
Read Comfy 2918
Read Comfy 2919
Read Comfy 2920
Read Comfy 2921
Read Comfy 2922
Read Comfy 2923
Read Comfy 2924
Read Comfy 2925
Read Comfy 2926
Read Comfy 2927
Read Comfy 2928
Read Comfy 2929
Read Comfy 2930
Read Comfy 2931
Read Comfy 2932
Read Comfy 2933
Read Comfy 2934
Read Comfy 2935
Read Comfy 2936
Read Comfy 2937
Read Comfy 2938
Read Comfy 2939
Read Comfy 2940
Read Comfy 2941
Read Comfy 2942
Read Comfy 2943
Read Comfy 2944
Read Comfy 2945
Read Comfy 2946
Read Comfy 2947
Read Comfy 2948
Read Comfy 2949
Read Comfy 2950
Read Comfy 2951
Read Comfy 2952
Read Comfy 2953
Read Comfy 2954
Read Comfy 2955
Read Comfy 2956
Read Comfy 2957
Read Comfy 2958
Read Comfy 2959
Read Comfy 2960
Read Comfy 2961
Read Comfy 2962
Read Comfy 2963
Read Comfy 2964
Read Comfy 2965
Read Comfy 2966
Read Comfy 2967
Read Comfy 2968
Read Comfy 2969
Read Comfy 2970
Read Comfy 2971
Read Comfy 2972
Read Comfy 2973
Read Comfy 2974
Read Comfy 2975
Read Comfy 2976
Read Comfy 2977
Read Comfy 2978
Read Comfy 2979
Read Comfy 2980
Read Comfy 2981
Read Comfy 2982
Read Comfy 2983
Read Comfy 2984
Read Comfy 2985
Read Comfy 2986
Read Comfy 2987
Read Comfy 2988
Read Comfy 2989
Read Comfy 2990
Read Comfy 2991
Read Comfy 2992
Read Comfy 2993
Read Comfy 2994
Read Comfy 2995
Read Comfy 2996
Read Comfy 2997
Read Comfy 2998
Read Comfy 2999
Read Comfy 3000

Related Articles

Leave a Reply

Your email address will not be published.

Back to top button