- Drupal 8 Quick Start Guide
- J. Ayen Green
- 301字
- 2021-06-10 19:45:30
Content as fields
We sometimes tend to think of content as a big block of body text, but content can be stored as discreet fields so that important elements can be easily accessed and properly formatted:
You can see the same content in this form as you did on the page. However, here you also see the fields that hold that content. The content title is in a field labeled Title, and the main text is in a field labeled Body. There are two additional fields that are not being used by this particular piece of content: a field for categories, labeled Tags, and one that is used for attaching an image to the content, labeled Image.
By having a Title field and a Body field, both the user and Drupal understand that the information in each is separate from the other. This doesn't mean that they cannot be displayed together, but there are many reasons why we may want to be able to differentiate them.
For example, when this content was displayed on the homepage, the title and the body text were formatted differently. Another example is that we might want to have Drupal provide us with a list of content titles. In both examples, it is important for Drupal to be able to determine which part of the content is the title. If all of the content in the piece was thrown together, there would be no way for Drupal to know where the title ends and the body text begins. Having them in separate fields removes any ambiguity.
So, we have seen what the content looks like when separated into separate fields. But where do the fields come from? How does Drupal know which fields to offer to receive our input? Let's take a look at that next.
- 玩轉Scratch少兒趣味編程
- 跟“龍哥”學C語言編程
- 人人都是網站分析師:從分析師的視角理解網站和解讀數據
- PySide GUI Application Development(Second Edition)
- Hands-On Automation Testing with Java for Beginners
- D3.js By Example
- IBM Cognos Business Intelligence 10.1 Dashboarding cookbook
- Creating Data Stories with Tableau Public
- Scratch趣味編程:陪孩子像搭積木一樣學編程
- Illustrator CC平面設計實戰從入門到精通(視頻自學全彩版)
- SQL Server 2016 從入門到實戰(視頻教學版)
- HTML5+CSS3+JavaScript 從入門到項目實踐(超值版)
- Julia數據科學應用
- Visual C++從入門到精通(第2版)
- Python編程入門(第3版)