Uncategorized

Build a Blog in Drupal 8: Content types and Fields

This tutorial is part of the “Build a Blog in Drupal 8” series:

  1. Content types and Fields
  2. Adding Comments
  3. Using Views
  4. Managing Blocks
  5. Create and Manage Menus
  6. Custom Contact Forms

With Drupal 8 on the horizon, now is a good time to start using it. The best way to learn the new version is to build something with it.

Over the next few weeks, I’ll be publishing a series of tutorials teaching you how to create a blog in Drupal 8. The aim of the series is to help new comers, as well as experienced site builders, how to create a blog website using Drupal 8.

Throughout each tutorial, major changes between Drupal 7 and 8 will be highlighted. Even if you know Drupal 7, follow along and you’ll learn what’s new in Drupal 8.

In this first tutorial, you’ll learn how to create a Blog content type and how to add custom fields. You’ll also learn about the Taxonomy system by creating your own vocabulary to categorize blog posts.

Install Drupal

Before we begin, make sure you have installed Drupal 8 using the Standard installation profile. I won’t go into details on installing it, but if you need to spin up a test site then check out simplytest.me. Just type in “Drupal core” into the project name field and select the latest Drupal 8 option from the drop-down list. Or click on this link.

Create Blog Content Type

When using the Standard installation profile, you’ll get an Article content type. This content type is useful. It comes with an Image and Tags field. On a proper Drupal project you would use this content type for a blog section.

But to learn how they work, we’ll need to create our own. So we’ll create a Blog content type with the following fields:

  • Body
  • Image
  • Tags
  • Category

To save time we’ll reuse the Image and Tags field which is already on the Article content type, but we’ll need to create a Category field which will allow you to categorize blog posts.

1. Click on Structure in the toolbar, “Content types” and click “Add content type”.

2. Enter in Blog into the Name field and enter “Used in the daily blog section.” into the Description field.

Fig 1.0

3. Below the Description, you’ll see a group of vertical tabs. Here you can configure content type settings like “Publishing options” and “Display options” and more. These options can be changed at anytime, so we’ll leave them as they are for now.

Fig 1.1

When you’re ready click on “Save and manage fields”.

Adding Fields

Once you’ve created a content type, you’ll be redirected to the “Manage fields” page where you can create new fields and edit existing ones.

When a new content type’s created Drupal will add a Body field. This is default functionality, if you don’t want to use the field simply delete it.

Fig 1.2

As mentioned earlier, the Blog content type will have four fields: Body, Image, Tags and Category.

The Body is already on the content type, but we’ll need to add Image and Tags. The Standard installation profile already created these fields and attached them to the Article content type. Let’s just save time and reuse these fields.

 

 

Read More 501
Read More 502
Read More 503
Read More 504
Read More 505
Read More 506
Read More 507
Read More 508
Read More 509
Read More 510
Read More 511
Read More 512
Read More 513
Read More 514
Read More 515
Read More 516
Read More 517
Read More 518
Read More 519
Read More 520
Read More 521
Read More 522
Read More 523
Read More 524
Read More 525
Read More 526
Read More 527
Read More 528
Read More 529
Read More 530
Read More 531
Read More 532
Read More 533
Read More 534
Read More 535
Read More 536
Read More 537
Read More 538
Read More 539
Read More 540
Read More 541
Read More 542
Read More 543
Read More 544
Read More 545
Read More 546
Read More 547
Read More 548
Read More 549
Read More 550
Read More 551
Read More 552
Read More 553
Read More 554
Read More 555
Read More 556
Read More 557
Read More 558
Read More 559
Read More 560
Read More 561
Read More 562
Read More 563
Read More 564
Read More 565
Read More 566
Read More 567
Read More 568
Read More 569
Read More 570
Read More 571
Read More 572
Read More 573
Read More 574
Read More 575
Read More 576
Read More 577
Read More 578
Read More 579
Read More 580
Read More 581
Read More 582
Read More 583
Read More 584
Read More 585
Read More 586
Read More 587
Read More 588
Read More 589
Read More 590
Read More 591
Read More 592
Read More 593
Read More 594
Read More 595
Read More 596
Read More 597
Read More 598
Read More 599
Read More 600
Read More 601
Read More 602
Read More 603
Read More 604
Read More 605
Read More 606
Read More 607
Read More 608
Read More 609
Read More 610
Read More 611
Read More 612
Read More 613
Read More 614
Read More 615
Read More 616
Read More 617
Read More 618
Read More 619
Read More 620
Read More 621
Read More 622
Read More 623
Read More 624
Read More 625
Read More 626
Read More 627
Read More 628
Read More 629
Read More 630
Read More 631
Read More 632
Read More 633
Read More 634
Read More 635
Read More 636
Read More 637
Read More 638
Read More 639
Read More 640
Read More 641
Read More 642
Read More 643
Read More 644
Read More 645
Read More 646
Read More 647
Read More 648
Read More 649
Read More 650
Read More 651
Read More 652
Read More 653
Read More 654
Read More 655
Read More 656
Read More 657
Read More 658
Read More 659
Read More 660
Read More 661
Read More 662
Read More 663
Read More 664
Read More 665
Read More 666
Read More 667
Read More 668
Read More 669
Read More 670
Read More 671
Read More 672
Read More 673
Read More 674
Read More 675
Read More 676
Read More 677
Read More 678
Read More 679
Read More 680
Read More 681
Read More 682
Read More 683
Read More 684
Read More 685
Read More 686
Read More 687
Read More 688
Read More 689
Read More 690
Read More 691
Read More 692
Read More 693
Read More 694
Read More 695
Read More 696
Read More 697
Read More 698
Read More 699
Read More 700
Read More 701
Read More 702
Read More 703
Read More 704
Read More 705
Read More 706
Read More 707
Read More 708
Read More 709
Read More 710
Read More 711
Read More 712
Read More 713
Read More 714
Read More 715
Read More 716
Read More 717
Read More 718
Read More 719
Read More 720
Read More 721
Read More 722
Read More 723
Read More 724
Read More 725
Read More 726
Read More 727
Read More 728
Read More 729
Read More 730
Read More 731
Read More 732
Read More 733
Read More 734
Read More 735
Read More 736
Read More 737
Read More 738
Read More 739
Read More 740
Read More 741
Read More 742
Read More 743
Read More 744
Read More 745
Read More 746
Read More 747
Read More 748
Read More 749
Read More 750
Read More 751
Read More 752
Read More 753
Read More 754
Read More 755
Read More 756
Read More 757
Read More 758
Read More 759
Read More 760
Read More 761
Read More 762
Read More 763
Read More 764
Read More 765
Read More 766
Read More 767
Read More 768
Read More 769
Read More 770
Read More 771
Read More 772
Read More 773
Read More 774
Read More 775
Read More 776
Read More 777
Read More 778
Read More 779
Read More 780
Read More 781
Read More 782
Read More 783
Read More 784
Read More 785
Read More 786
Read More 787
Read More 788
Read More 789
Read More 790
Read More 791
Read More 792
Read More 793
Read More 794
Read More 795
Read More 796
Read More 797
Read More 798
Read More 799
Read More 800
Read More 801
Read More 802
Read More 803
Read More 804
Read More 805
Read More 806
Read More 807
Read More 808
Read More 809
Read More 810
Read More 811
Read More 812
Read More 813
Read More 814
Read More 815
Read More 816
Read More 817
Read More 818
Read More 819
Read More 820
Read More 821
Read More 822
Read More 823
Read More 824
Read More 825
Read More 826
Read More 827
Read More 828
Read More 829
Read More 830
Read More 831
Read More 832
Read More 833
Read More 834
Read More 835
Read More 836
Read More 837
Read More 838
Read More 839
Read More 840
Read More 841
Read More 842
Read More 843
Read More 844
Read More 845
Read More 846
Read More 847
Read More 848
Read More 849
Read More 850
Read More 851
Read More 852
Read More 853
Read More 854
Read More 855
Read More 856
Read More 857
Read More 858
Read More 859
Read More 860
Read More 861
Read More 862
Read More 863
Read More 864
Read More 865
Read More 866
Read More 867
Read More 868
Read More 869
Read More 870
Read More 871
Read More 872
Read More 873
Read More 874
Read More 875
Read More 876
Read More 877
Read More 878
Read More 879
Read More 880
Read More 881
Read More 882
Read More 883
Read More 884
Read More 885
Read More 886
Read More 887
Read More 888
Read More 889
Read More 890
Read More 891
Read More 892
Read More 893
Read More 894
Read More 895
Read More 896
Read More 897
Read More 898
Read More 899
Read More 900
Read More 901
Read More 902
Read More 903
Read More 904
Read More 905
Read More 906
Read More 907
Read More 908
Read More 909
Read More 910
Read More 911
Read More 912
Read More 913
Read More 914
Read More 915
Read More 916
Read More 917
Read More 918
Read More 919
Read More 920
Read More 921
Read More 922
Read More 923
Read More 924
Read More 925
Read More 926
Read More 927
Read More 928
Read More 929
Read More 930
Read More 931
Read More 932
Read More 933
Read More 934
Read More 935
Read More 936
Read More 937
Read More 938
Read More 939
Read More 940
Read More 941
Read More 942
Read More 943
Read More 944
Read More 945
Read More 946
Read More 947
Read More 948
Read More 949
Read More 950
Read More 951
Read More 952
Read More 953
Read More 954
Read More 955
Read More 956
Read More 957
Read More 958
Read More 959
Read More 960
Read More 961
Read More 962
Read More 963
Read More 964
Read More 965
Read More 966
Read More 967
Read More 968
Read More 969
Read More 970
Read More 971
Read More 972
Read More 973
Read More 974
Read More 975
Read More 976
Read More 977
Read More 978
Read More 979
Read More 980
Read More 981
Read More 982
Read More 983
Read More 984
Read More 985
Read More 986
Read More 987
Read More 988
Read More 989
Read More 990
Read More 991
Read More 992
Read More 993
Read More 994
Read More 995
Read More 996
Read More 997
Read More 998
Read More 999
Read More 1000

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button