- 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.
- SPSS數(shù)據(jù)挖掘與案例分析應(yīng)用實踐
- Rust實戰(zhàn)
- 趣學(xué)Python算法100例
- R語言游戲數(shù)據(jù)分析與挖掘
- Rust Essentials(Second Edition)
- Jupyter數(shù)據(jù)科學(xué)實戰(zhàn)
- 微服務(wù)從小白到專家:Spring Cloud和Kubernetes實戰(zhàn)
- Django實戰(zhàn):Python Web典型模塊與項目開發(fā)
- Arduino Wearable Projects
- 你真的會寫代碼嗎
- Python Linux系統(tǒng)管理與自動化運維
- Learning Cocos2d-JS Game Development
- Unity與C++網(wǎng)絡(luò)游戲開發(fā)實戰(zhàn):基于VR、AI與分布式架構(gòu)
- Netty 4核心原理與手寫RPC框架實戰(zhàn)
- 語義Web編程