官术网_书友最值得收藏!

  • Drupal 8 Blueprints
  • Alex Burrows
  • 276字
  • 2021-07-03 00:03:24

Creating our fields

Now that we have our Post content type created, we need to add the fields we want to use:

Fig 1.3: Adding fields to content type

In Fig 1.3, we can see the layout for adding fields to our content type; we can see that there is already a field called Body, which is created by default; the field UI is split into four columns:

  • LABEL: This is our user-friendly label; when we enter our label, this generates the machine name.
  • MACHINE NAME: This is the unique name for the field; fields can be reused throughout Drupal, but only one per content type. If we create a field called subtitle, it will generate the machine name as field_subtitle; we can, however, override this to name it how we want.
  • FIELD TYPE: There are various types of fields (text, list, autocomplete, and so on), which are created by plugins, but for now these are the ones we have in Drupal core.
  • OPERATIONS: These are the features of the field.
  • Edit: This allows us to edit the basic settings for the field, including label, help text, default value, and any other configuration that is required for the field.
  • Storage settings (Field settings): This allows us to set the number of fields we require for this field.

Now that we have a basic understanding of the field system, let's move ahead and create our fields. We do, however, need to categorize the posts after we have created our basic fields so that we get an understanding of what happens; we will then add the categories known in Drupal as taxonomy.

主站蜘蛛池模板: 洪泽县| 苍山县| 龙山县| 罗甸县| 宁河县| 崇文区| 旌德县| 滁州市| 万年县| 微山县| 樟树市| 东港市| 调兵山市| 阿拉善左旗| 浦城县| 绥宁县| 原阳县| 浦东新区| 深泽县| 时尚| 钦州市| 黔西| 汶上县| 木兰县| 应用必备| 射阳县| 来安县| 蓬莱市| 泰州市| 石柱| 普安县| 张北县| 嘉义市| 江陵县| 杂多县| 剑川县| 南岸区| 武隆县| 漳平市| 高陵县| 嘉义县|