Getting Started
Positionable Objects
Some resources in the Plate API can be positioned relative to their parent. These are known as positionable objects.
Examples of Positionable Relationships
- Sections within a Post
- Rows within a Section
Within their parent, each positionable object has a unique, sequential Position
value.
Position Rules
- The position is a 1-based index.
- Positons must be:
- An integer
- Greater than or equal to 1
- Less than or equal to the total number of positionable siblings in the same parent
Example
If a post contains 3 sections:
Section | Position |
---|---|
First | 1 |
Second | 2 |
Third | 3 |
Response Format
The Position
is included in the attributes
object of the response.
Example response
{
"data": {
"id": 1,
"type": "elements",
"attributes": {
"position": 1,
...
}
}
}
Setting a Position
You can set the position of a resource when creating or updating a positionable object by including the Position
field in the request payload.
Example Request
{
"data": {
"position": 2,
...
}
}
The position value must follow the same rules as above: an integer between 1 and the number of items in the parent container.