* items semi complete
* updated items page to use snippet toggler and migrated endpoint docs to use it
* updated files page to use snippet toggler and migrated REST and GraphQL endpoint docs to it
* updated activity page to use snippet toggler and migrated REST and GraphQL endpoint doc to it
* updated collections page to use snippet togglers and migrated REST and GraphQL endpoint docs to them
* updated dashboards page to use snippet togglers and migrated REST and GraphQL endpoint docs to them
* Updated extensions page to use snippet togglers and migrated REST and GraphQL endpoint docs to them
* Updated fields page to use snippet togglers and migrated REST and GraphQL endpoint docs to them
* Updated flows page to use snippet togglers and migrated REST and GraphQL endpoint docs to them
* Updated folders page to use snippet togglers and migrated REST and GraphQL endpoint docs to them
* Updated notifications page to use snippet togglers and migrated REST and GraphQL endpoint docs to them
* Updated operations page to use snippet togglers and migrated REST and GraphQL endpoint docs to them
* Updated panels page to use snippet togglers and migrated REST and GraphQL endpoint docs to them
* Updated permissions page to use snippet togglers and migrated REST and GraphQL endpoint docs to them
* Updated presets page to use snippet togglers and migrated REST and GraphQL endpoint docs to them
* Updated relations page to use snippet togglers and migrated REST and GraphQL endpoint docs to them
* Updated revisions page to use snippet togglers and migrated REST and GraphQL endpoint docs to them
* Updated roles page to use snippet togglers and migrated REST and GraphQL endpoint docs to them
* Made headlines consistant with the rest of the doc pages
* Updated server page to use snippet togglers and migrated REST and GraphQL endpoint docs to them
* Updated settings page to use snippet togglers and migrated REST and GraphQL endpoint docs to them
* Updated shares page to use snippet togglers and migrated REST and GraphQL endpoint docs to them
* Updated translations page to use snippet togglers and migrated REST endpoint docs to them
* Updated users page to use snippet togglers and migrated REST and GraphQL endpoint docs to them
* Updated utilities page to use snippet togglers and migrated REST and GraphQL endpoint docs to them
* Updated webhooks page to use snippet togglers and migrated REST and GraphQL endpoint docs to them
* Updated authentication page to use snippet togglers and migrated REST and GraphQL endpoint docs to them
* Updated Global Parameters page to use snippet togglers where there are adjacent REST and GraphQL Examples
* Added SDK code snippets to items page and made generic variables consistant
* Added SDK code snippets to files page and made generic variables consistant
* Few lang changes for files page
* Added SDK code snippets to activity page and made generic variables consistant
* Added SDK code snippets to collections page and made generic variables consistant
* Added SDK code snippets to dashboards page and made generic variables consistant
* removed query word from query parameter objects
* Added SDK code snippets to fields page and made generic variables consistant
* SnippetToggler border
* Used dynamic border color for snippettoggler heading
* Spacing top and bottom of snippet toggler in docs
* Removed extra HRs
* Remove manual TOC in query reference
* Small code styling change in items page
* Updated users page to use snippet togglers and migrated REST and GraphQL endpoint docs to them
* dashboards fixed up property names
* Small copy update on extensions page
* Updated keys in delete mult notifications REST
* Updated keys in operations
* Update keys in panel delete many
* Update keys in permissions
* Added quotes around generic example ID strings
* Added code formatting to final example in share public info
* Format files
* Refined sidebar
* Insert newline before ending template tags
* Fixed extra closing tags, causing an error, un users ref
* Text Formatting Users
* Put GQL related notes inside toggler
* Added SDK code snippets to flows page and made generic variables consistant
* Added SDK code snippets to folder page and made generic variables consistant
* fixing whitepsace for flows and folders page
* Consistent newlines in SnippetToggler usages
* Run prettier
* Fix 'alwaysDark' definition
* Home page snippet toggler style fixes
* Fix snippet toggler lang hover color in light mode
* Introduce different code theme for light mode
* Added SDK code snippets to notifications page and made generic variables consistant
* Switch to 'material-theme-lighter'
* Format file
* Fix tip
* Fix tip in sdk ref
* Consistent spacing for custom containers
* Added SDK code snippets to operations page and made generic variables consistant
* Lint & format code blocks
* Lint & format operations
* Added SDK code snippets to panels page and made generic variables consistant
* Added SDK code snippets to permissions page and made generic variables consistant
* Added SDK code snippets to presets page and made generic variables consistant
* Added SDK code snippets to relations page and made generic variables consistant
* Added SDK code snippets to revisions page and made generic variables consistant
* Added SDK code snippets to roles page and made generic variables consistant
* Added SDK code snippets to server page and made generic variables consistant
* Added SDK code snippets to settings page and made generic variables consistant
* app_url -> directus_project_url
* Omitted auth details in delete multiple files
* Added quotes to values in roles
* Upload a file snippets
* Pluralization for upload/import files
* More files functions typos
* Added SDK code snippets to shares page (still missing createShare(s) as endpoint not functioning currently) and made generic variables consistant
* Added SDK code snippets to translations page (missing delete endponts because not working) and made generic variables consistant
* Added SDK code snippets to users page and made generic variables consistant
* Added SDK code snippets to webhooks page and made generic variables consistant
* Added SDK code snippets to utilites page (except cleaning cache, will be tested and added in later commit) and made generic variables consistant
* Added SDK code snippets to auth page (not login, refresh, and logout though due to errors)
* Added SDK code snippets for utilsExport and clearCache
* added github username be7DOTis to contributors
* Omit auth commands in updateComment
* utilsImport
* rename app_url generic value
* changed instances of updated*operation* to update*Operation*
* missed some 'updated' changse
* Added SDK Snippets to Query Parameters page
* Add section on file security
* added create(s)Shares SDK snippet to shares page
* added console.log to create snippets
* Added delete(s)Webhook SDK snippet to webhooks page
* Added SDK snippets to extensions page
* Added create/updateSingleton section to items page
* Links in files security
* Added SDK Snippets to Schema page
* Added GQL Generic examples to snippet togglers and removed snippet toggler from Login Using SSO Providers
* Added create(s)Presets SDK Snippets to presets page
* replaced fields query in generics snippets for a more generic
* replaced fields query in generics snippets for a more generic
* Use storage value only if valid choice
* Sync snippet togglers across page
* Update docs/reference/system/activity.md
* Update docs/reference/system/activity.md
* Update docs/reference/system/extensions.md
* Update docs/reference/system/revisions.md
* Update docs/reference/system/settings.md
* Update docs/reference/system/revisions.md
* Update docs/reference/system/settings.md
* Update docs/reference/system/activity.md
* Update docs/reference/system/roles.md
* Update docs/reference/system/roles.md
* Update docs/reference/system/roles.md
* Update docs/reference/system/roles.md
* Update docs/reference/system/schema.md
* Update docs/reference/system/server.md
* Update docs/reference/system/shares.md
* Replace all directus_project_url placeholders
* Revert "Sync snippet togglers across page"
This reverts commit 8b36f0d778.
* Update docs/reference/system/shares.md
* Update docs/reference/system/webhooks.md
* Clarify singleton section
* Consistent newlines between SnippetToggler templates
* Format files
* Remove console.log(result) statements from snippet
* Add examples for shares & users
Co-authored-by: Brainslug <tim@brainslug.nl>
* Fix hash GraphQL example
* Clarify update singleton section
* Add auth examples
Co-authored-by: Brainslug <tim@brainslug.nl>
* Final run on consistent newlines between SnippetToggler
* Switch to github themes
* The "Last One"
Co-authored-by: Brainslug <tim@brainslug.nl>
* The "Big One"
* Fix dead links
---------
Co-authored-by: Bevis Halsey-Perry <hi@be7.is>
Co-authored-by: Kevin Lewis <kvn@lws.io>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
Co-authored-by: Brainslug <tim@brainslug.nl>
12 KiB
description, readTime
| description | readTime |
|---|---|
| Layouts are customized displays for viewing and interacting with the Items in a Collection. | 9 min read |
Layouts
Layouts are customized displays for viewing and interacting with the Items in a Collection. This makes working with specific types of data models, such as map locations or calendar events, a more human-friendly experience.
What's a Layout?
Data models vary drastically in shape and purpose, from eCommerce platforms to IoT fleets and everything in between. While excel-style data tables often closely resemble how the data is stored in the database, this is not always the most human-friendly way to view the data. Layouts provide intuitive displays to view and interact with Items in a Collection.
How it Works
To adjust an Item's Layout, follow these steps.
- Navigate to the Content Module and select the desired Collection.
- In the page Sidebar, click "Layout Options".
- Choose the desired Layout you want to use.
- Customize the Layout as desired.
Customization Controls
Customization controls can be found in the following three locations.
- Layout Options — Located in the Sidebar.
- Subheader — Located just below the Page Header and above the Page Area.
- Page Area — The center of the webpage, which displays all Items.
These controls typically fall into three general categories.
-
Styling and Formatting
These are additional customizations to the way a Layout displays such as the size of each Item, how images are cropped, etc. -
Field Values Displayed
Most Layouts allow you to choose which Field Value(s) are used to represent each Item on the Collection Page. For example, with blog posts, it may be ideal to have the hero image, blog title, date, author, etc. -
Manual and Automatic Sorting
Certain Layouts may allow sorting Items by value in ascending and descending order, drag-and-drop repositioning of Items, etc.
Key Takeaways
As you go through Layouts, it may be helpful to keep the following points in mind.
-
Layouts will not be universally usable for all Collections.
Layouts are tailored to work with specific data-models. For example, in order to work properly, the Map Layout requires the Collection have a Map Field configured and the Calendar Layout requires the Collection have a datetime Field configured. -
Controls are different for each Layout.
Each Layout presents data differently, so certain customizations may not be functional with certain Layouts. For example, the Map Layout displays each Item as a pin on a map, so this Layout has no controls for sorting. -
Controls for a Layout may be in different locations.
Depending on the Layout, the same control may be under Layout Options in the sidebar, the subheader, or on the Page Area (and Items themselves). For example, the Table Layout lets you set the Field Values displayed in the subheader while the Card Layout lets you set Field Values displayed in the Layout Options menu.
Table Layout
This Layout supports all forms of data, as it directly reflects how data is stored in a Collection. This is the default Layout used in the Content Module. It includes the following controls.
Layout Options
- Spacing — Adjust the vertical space a row takes up.
Subheader
- Adjust Column Width — Click and drag the column divider to resize as desired.
- Add Field — Select add in the page subheader and select the desired Field(s).
- Remove Field — Select arrow_drop_down in the column title and click "Hide Field".
- Sort Items by Column — Select arrow_drop_down in the column title and sort ascending or descending.
- Set Text Alignment — Select arrow_drop_down in the column title and set left, right, or center.
- Toggle & Reorder Columns — Click the column header, then drag-and-drop as desired.
- Select All — Click check_box_outline_blank in the selection column header.
Page Area
- Select Item(s) — Click check_box_outline_blank in the selection column for the desired Item(s).
- Manually Sort Items — Toggle sort in the configured Sort column to drag and drop drag_handle Items.
::: warning Manual Sorting Requires Configuration
Only available if you configure a sort field in the Collection's Data Model Settings.
:::
Card Layout
This tiled Layout is ideal for Collections that prioritize an image (e.g. a user or blog post). This is the default for both the User Directory and File Library. It includes the following controls.
Layout Options
- Image Source — Set the Field used as the display image.
- Title — Sets a display template to use as a title.
- Subtitle — Sets a display template to use as a subtitle.
- Image Fit — Set how an image fits inside the Card.
- Fallback Icon — Set a default icon to display when an Item has no image.
Subheader
- Card Size — Toggle the Card size as it appears in the Page Area.
- Order Field — Click to select the Field you wish to order by from the dropdown menu.
- Order Direction — Toggle ascending and descending order.
- Select All — Click "check_circle Select All" in the selection column header.
Page Area
- Select Item(s) — Click radio_button_unchecked in the selection column for the desired Item(s).
Calendar Layout
This Layout is ideal for Collections with time-oriented data (e.g. events and appointments). It includes the following controls.
Layout Options
- Display Template — Set a mix of Field values and text to represent Items on the calendar.
- Start Date Field — Choose Field to determine each Item's beginning time on the calendar.
- End Date Field — Choose Field to determine each Item's ending time on the calendar.
- First Day of The Week — Defines the beginning of the week on the calendar.
Subheader
- Toggle Month and Year — Move across time using the chevrons in the subheader.
- Today — Click to jump to the current date on the calendar.
- Month Week Day List — Adjust the time interval used to display Items in the Page Area.
Page Area
- Select Item — Click an Item on the calendar to open its Item Page.
::: tip Configuration Requirements
To use this Layout, the Collection will need at least one datetime Field to set a start time, but ideally two datetime Fields (to set a start time and end time).
:::
Map Layout
This Layout is ideal for Collections that emphasize geospatial data. It provides a world map, with Items displayed as points, lines, and other geometry. The following options are available:
Layout Options
- Basemap — Choose the map provider used for the Collection.
- Geospatial Field — Select the geospatial field type to display on screen:
- Map JSON Point — Supports latitude-longitude based, single-point locations.
- Map Geometry — Supports geometric areas such as lines and polygons.
- Display Template — Choose the Fields displayed when hovering over an Item on the map.
- Cluster Nearby Data — Toggle whether or not nearby Items get clustered into a single pin.
Subheader
There is no Subheader on the Map Layout.
Page Area
- Zoom — Click add and remove in the upper left hand corner of the Page Area to zoom in and out.
- Find my Location — Click my_location to zoom into your current location on the map.
- Reframe — Click the square in the upper left-hand corner to resize and reframe the map area.
- Select Item — Click a single Item to enter its Item Page.
- Select Items — Click and drag to select multiple Items at once, opening the Item Page.
::: tip Configuration Requirements
To use this Layout, the Collection must have a Map Field configured.
:::
Kanban Layout
This Layout is ideal for Collections that serve as project management tools or to-do lists, where each Item represents a task, because it groups Items onto columns according to their status (e.g. "Not Started", "In Progress", "Under Review", "Complete", or any other status defined). The following controls are available.
Layout Options
- Group By — Select the Field used to define Item status. See below for details.
- Card Title — Choose the Field use to serve as the title for each kanban board.
- Card Text — Choose a Field to display additional text on each Item.
Layout Options > Advanced
- Card Tags — Choose a Tag Field to be displayed on the Item.
- Card Date — Choose a Datetime Field to be displayed on each Item.
- Card Image — Choose an Image Field to be displayed on each Item.
- Card Image Fit — Toggle whether the image fit is cropped.
- Card User — Choose the User Created Field to display their avatar in the bottom right corner.
- Show Ungrouped — Toggle display of a column containing Items with no assigned status.
Subheader
There is no Subheader for the Kanban Layout.
Page Area
- Create Task and Assign Status — Click add in a status column and the Item Page will open.
- Sort Panels — Drag and drop Items to reposition or change task status.
- Add Status Panel — Click add_box and add a group name (i.e. new status column).
- Edit or Delete Status Column — Click more_horiz and then click edit to edit or delete to delete.
::: tip Configuration Requirements
To make this Layout work, you will need to configure an appropriate status Field on the Collection, then identify this Field under "Group By" in the Layout Options menu.
:::