You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/5.x/system/elements.md
+28-3Lines changed: 28 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -130,7 +130,7 @@ Craft can export sets of elements to CSV, JSON, or XML. The **Export…** button
130
130
131
131
A streamlined version of indexes are used when adding elements to a [relational](relations.md) field via a modal. Depending on the field’s configuration, Craft may hide sources or actions, and disable [slideouts](control-panel.md#slideouts) (except to create a new element, in-context) and pagination (in favor of scrolling). Internally, Craft refers to these variations as “contexts,” which [plugins](../extend/element-types.md#sources) have an opportunity to modify.
132
132
133
-
###Chips & Cards <Badgetext="New!" />
133
+
## Chips & Cards <Badgetext="New!" />
134
134
135
135
<imgsrc="../images/element-chips.png"alt="An element “chip” with a title, thumbnail, and label indicated it has been modified." />
136
136
@@ -140,7 +140,7 @@ Both chips and cards support thumbnails, but only cards allow additional custom
140
140
141
141
<imgsrc="../images/element-cards.png"alt="Two element “cards” in the Craft control panel, show thumbnails, titles, and statuses." />
The attributes and fields displayed on element cards is ultimately determined by the interface below each [field layout designer](fields.md#field-layouts):
146
146
@@ -152,7 +152,7 @@ An element’s **Title** and **Status** are always visible, and the presence of
152
152
A card’s thumbnail can come from any field that implements <craft5:craft\base\ThumbableFieldInterface> (like [assets](../reference/field-types/assets.md) or [icon](../reference/field-types/icon.md) fields), or be “inherited” from another element via a [relational field](relations.md).
153
153
:::
154
154
155
-
###Copying Elements <Sincever="5.7.0"feature="Copying elements" />
155
+
## Copying Elements <Sincever="5.7.0"feature="Copying elements" />
156
156
157
157
[Entries](../reference/element-types/entries.md) and [addresses](../reference/element-types/addresses.md) can by copied-and-pasted between sections and fields. Open the action menu <Iconkind="ellipses" /> on any chip, card, or inline nested entry and select **Copy <Placeholderhelp="A built-in or plugin-provided element type.">element type</Placeholder>**:
158
158
@@ -176,6 +176,31 @@ The **Paste** button is displayed in the same row as the **Add** button for nest
176
176
A copied [draft](drafts-revisions.md) (provisional or otherwise) is pasted as a _canonical_ element, with the pending changes applied.
177
177
:::
178
178
179
+
## Statuses
180
+
181
+
Most element types support _statuses_. An element’s status is most often a combination of its `enabled` and `enabledForSite` attributes (which Craft stores explicitly for all elements), and any number of other attributes determined by its type. Statuses are represented as strings, and can be accessed via `element.status` in a template, or fed into element query’s `.status()` param as a short-hand for the combination of specific properties they represent.
182
+
183
+
-**Draft** (`draft`) — The element has a `draftId`.
184
+
-**Archived** (`archived`) — The element’s `archived` property is `true`; currently only used by [user](../reference/element-types/users.md) elements.
185
+
-**Disabled** (`disabled`) — One or both of the `enabled` and `enabledForSite` attributes are `false`.
186
+
-**Enabled** — Both the `enabled`_and_`enabledForSite` attributes are `true`.
187
+
188
+
::: tip
189
+
To query for elements without applying _any_ status constraints (including the element type’s defaults), use `query.status(null)`.
190
+
:::
191
+
192
+
An element’s status is reflected in element indexes, chips, and cards through color pips and labels.
193
+
194
+

195
+
196
+
<Blocklabel="Provisional Drafts and Statuses">
197
+
198
+
In the illustration above, **Edited** is technically a supplemental label applied to [provisional drafts](drafts-revisions.md#provisional-drafts), and is not a status on its own—but it is often applied in combination with other statuses. Elements with this label have been “substituted” for their canonical counterparts, meaning that provisional changes (like a new title) will appear with a **Live** status.
199
+
200
+
Conversely, disabling an element in a provisional draft may make it _appear_ as **Disabled** throughout the control panel, despite its canonical element actually being **Live**. Despite this, sorting and filtering always operates on the canonical element; the derivative is substituted as the final step in the query.
201
+
202
+
</Block>
203
+
179
204
## Nested Elements
180
205
181
206
Craft ships with two native _nested element_ implementations, which provide unique authoring or administrative experiences:
0 commit comments