Core concepts
Drupal has its own vocabulary. These words appear in the panel, in the documentation and in class names, so you need to meet them before the first module. Everything listed in this lesson is configured in the panel, without code.
Nodes and content types
A node is a unit of content: an article, a page, a news item. Each node has a number, a title, an author and a creation date. The page of a node opens at /node/1, where 1 is the number.
A content type sets the list of fields. The standard installation has two: Article with the machine name article and Basic page — page. A machine name is a short name in Latin letters used to refer to the type from code.
Content types are at Structure → Content types, the address /admin/structure/types. Create two or three articles through Content → Add content → Article: the next lessons need them.
Fields
A field is a part of a node: text, a number, a date, an image, a reference to another node. After installation an article has the fields body (text), field_image (image) and field_tags (tags). Fields added in the panel get names with the field_ prefix.
Fields are added on the Manage fields tab of the content type. Next to it, the Manage display tab sets the order and look of the fields on the page.
Taxonomy
Taxonomy means vocabularies of terms for grouping content: sections, tags, cities. The tags vocabulary already exists and is linked to articles by the field_tags field. Vocabularies are at Structure → Taxonomy.
Blocks
A block is a piece of the page outside the main content: a menu, a search form, a list of latest articles. The theme splits the page into regions — header, sidebar, footer — and the administrator places blocks into them at Structure → Block layout, the address /admin/structure/block.
Views
A view (the Views module) is a list builder. You choose what to show, which conditions to filter by and how to sort, and Drupal builds the query and the page itself. The front page with the list of articles is a view too. See Structure → Views.
Entities
Entity is the general name for everything Drupal stores as separate records.
| Entity | Machine name | What it is |
|---|---|---|
| Node | node | Articles, pages |
| User | user | Accounts |
| Taxonomy term | taxonomy_term | Sections and tags |
| File | file | Uploaded files |
| Comment | comment | Comments on nodes |
All entities share one way of loading, saving and searching — it is covered in the Data chapter. A variety of an entity is called a bundle: for a node it is the content type, for a term it is the vocabulary.
Common mistake
Labels in the panel can be translated and renamed; machine names cannot. The Article type is always article in code, the image field is field_image. Referring to something by its display label does not work. The machine name is shown in the list of content types and on the Manage fields tab.