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

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

Creating the Post content type

In Drupal, we use the terminology of entity, and we have bundles inside an entity. As part of the Drupal core functionality, we have content types, which is in fact an entity type and therefore the Post content type is a bundle.

So, now that we are familiar with some basic Drupal terminology, let's move on to creating our Post content type.

If you use the menu at the top and click on Manage | Structure | Content Types, you will be taken to the Admin page for Content types:

Fig 1.1: The content type management page

By default, we have two content types in a standard Drupal installation (Basic page and Article). Article is pretty much a Post content type; however, for this, we shall ignore this and create our own content type entirely from scratch.

To create a new content type, click on + Add content type:

Fig 1.2: The Add content type page

On this page, we are presented with some fields, which we use to set up how a content type works.

So, let's add the information for these fields:

  • Name: Post
  • Description: Create a new post to display
  • Menu settings: Uncheck all available menus

Click on Save and manage fields, and we have now started our Post content type.

The content type is split into four tabs:

  • Edit: This allows for the settings we just added to be modified; however, you cannot change the machine name once the content type is created.
  • Manage fields: This allows us to add/edit/remove fields from the content type. In the previous versions of Drupal, you could move the fields up and down to order how they appear on the form. This is no longer the case and appears under the Manage form display tab.
  • Manage form display: This allows for the fields to be reordered and the formats to be amended for this page. This won't affect the Manage display tab. It will only be visible to any user who has permission to add, edit, or delete.
  • Manage display: This allows the fields to be reordered for how they will appear on the display. It will affect the output of how the fields are displayed on the page.
主站蜘蛛池模板: 卓资县| 邢台市| 泾源县| 鄢陵县| 邓州市| 梨树县| 申扎县| 五家渠市| 富源县| 宜春市| 定襄县| 肇东市| 仪征市| 思茅市| 临邑县| 商水县| 白城市| 清镇市| 屯留县| 安福县| 宣汉县| 旺苍县| 泽州县| 丰县| 广南县| 彩票| 德化县| 红原县| 镇康县| 台山市| 哈尔滨市| 乌兰察布市| 汕尾市| 西贡区| 南岸区| 二连浩特市| 黔西县| 保定市| 济阳县| 长沙县| 湾仔区|