Back to Directus

Collection Explorer

content/guides/02.content/1.explore.md

latest4.5 KB
Original Source

The content module allows users to browse, filter, and search for items held in collections. When users navigate into viewing single items, they use :product-link{product="editor"}. Each page contains data from a single collection, but can display related fields for each item.

To open the collection explorer, click on the content module on the left hand side of the page.

Filtering Items

You can create custom filters to display items that fulfill certain criteria.

Click on :icon{name="material-symbols:filter-list"} at the top of the page to create a filter. You can then select a field to filter by and click on the criterion to tweak what should pass for that item to be filtered.

And / Or Groups

AND groups give the option to filter for items that meet all of several criteria. On the other hand, OR groups filter for items that meet any one of several criteria.

In order for filters to be included in AND or OR groups, filters must be indented below them in the filter UI.

Dynamic Variables

:video-embed{video-id="cc653542-7721-4b37-8978-60fee90081dc"}

The following dynamic variables are built into Directus to add extra functionality to filters:

  • $CURRENT_USER — The primary key of the currently authenticated user.
  • $CURRENT_ROLE — The primary key of the role for the currently authenticated user.
  • $CURRENT_ROLES - An array of roles containing the $CURRENT_ROLE and any roles included within it.
  • $CURRENT_POLICIES - An array of policies assigned to the user directly, or through their roles.
  • $NOW — The current timestamp.
  • $NOW(<adjustment>) - The current timestamp plus/minus a given distance, for example $NOW(-1 year), $NOW(+2 hours).

:video-embed{video-id="a0f37f8b-c789-4421-b6c4-e4f681028d66"}

Layouts

Layouts are customized mechanisms for viewing and interacting with the items in a collection. You can select a layout for displaying your collection. Note that restrictions will apply depending on your collection's data model.

Batch Editing

By selecting more than one item in the explorer will allow you to click on :icon{name="material-symbols:filter-list"} and edit several items' fields at once to have the same value.

Bookmarks

:video-embed{video-id="2766c70a-1fc0-46b1-ac5e-b464ca245334"}

Bookmarks are custom views for your collections that include specified configurations, layouts, visible fields, sorting, filtering and more.

To create a bookmark, navigate to the Settings -> Bookmarks module. Here, you can create a new one by clicking on :icon{name="material-symbols:add-circle-outline-rounded"}.

You'll see the "Editing Preset" form, where you can set the name and collection, amongst layout and other values for this bookmark. Note that leaving the name field empty will make it so this bookmark is what is viewed for this collection by default.

<!-- Each Collection Page displays all Items in its Collection and comes with highly configurable Layouts for browsing, visualizing, and managing Items. The Page Header includes key action buttons for sorting, searching, filtering, creating, editing, archiving, and deleting multiple Items. To learn more, see our guide on the Collection Page. The Content Module consists of :product-link{product="explore"}, where multiple items from a collection are displayed, and :product-link{product="editor"}, where single items can be displayed and edited. A powerful, yet extensible, way to explore your database. Suitable for everyone in your organization with a robust permissions system. Filters & Search: Filter your data with our powerful query builder across just one or related collections. 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. Save layout presets: Save your data layouts, filters, and sorts in presets and make them available to specific users or roles.