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

  • Drupal 8 Quick Start Guide
  • J. Ayen Green
  • 531字
  • 2021-06-10 19:45:30

What is content?

We all know what content is...sort of. This book is made up of content. This chapter contains content, as does this section within this chapter. The more important question is: what is it in the context of Drupal? This question is best answered with the home page as an example, because you'll know it when you see it!

The following screenshot shows a piece of content that I added to the site, in the main content area, with a thick rectangle around it:

When rendered and displayed in the browser, it's simply content, but up until that point, it is content of a certain type, of a content type, also known in Drupal as a node bundle. Does Drupal look at this content simply as:

Chapter 2 - Understanding Content Types
We all know what content is ... sort of. This book is made up of content. This chapter contains content, as does this section within the chapter. The more important question is, what is it in the context of Drupal? The question is best answered with the home page as an example, because you'll know it when you see it.

No, content is stored within Drupal in a way that facilitates selecting it based on almost any criteria you wish.

Let's take a look at the database for a moment. This isn't something that you need to learn, but it's good for illustration purposes. If we were to look at the main identifying information for this piece of content within the Drupal database, we would see this:

+-----+------+---------+--------------------------------------+----------+
| nid | vid | type | uuid | langcode |
+-----+------+---------+--------------------------------------+----------+
| 1 | 3 | article | 6166dc8e-1c64-4897-807e-7c535934f616 | en |
+-----+------+---------+--------------------------------------+----------+

You can see this in the article value in the type column, which contains the content type in this table. "Article" is the content type of our content. Let's leave the database behind and look at our content and its content type in the way that you will use it, via the user interface (UI).

In the Drupal documentation, you will often find a URL specified in an abbreviated manner, omitting the domain name to avoid confusion since most users will be using different domain names, so instead of mysite.com/page1 you might simply see /page1

One of the pages used most often by a content editor is the content administration page. We'll begin there by clicking the Content link in the admin menu, which will take us to admin/content, as shown in the following screenshot:

As you can see in the preceding screenshot, our content is listed, its title is on the left, and the type given is Article. We will learn more about the use of this page in Chapter 4, Creating and Editing Content, but for now we want to use it to lead us to the page on which we can edit our content. Let's click the Edit link at the opposite end of the row from the content title, which will display a node edit form for the content, as shown in the following screenshot:

主站蜘蛛池模板: 博客| 清镇市| 平泉县| 肃北| 太湖县| 平陆县| 东港市| 舞阳县| 寿阳县| 兰考县| 黎川县| 台安县| 桑日县| 外汇| 平果县| 施秉县| 博罗县| 大石桥市| 昌平区| 文昌市| 武安市| 石河子市| 遵义市| 易门县| 子长县| 江达县| 新乐市| 寻乌县| 石渠县| 灵寿县| 勃利县| 敖汉旗| 绩溪县| 莆田市| 大冶市| 长沙市| 灌南县| 富裕县| 吴旗县| 灵璧县| 渝北区|