From 039d5820cd5f10afe9be43b2a95d438cec4aae22 Mon Sep 17 00:00:00 2001 From: Carmen Huidobro Date: Tue, 8 Oct 2024 12:01:28 +0200 Subject: [PATCH 01/27] Write up versioning and import/export --- content/3.content/4.import-export.md | 61 ++++++++++++++++++++- content/3.content/6.content-versioning.md | 64 ++++++++++++++++++++++- 2 files changed, 123 insertions(+), 2 deletions(-) diff --git a/content/3.content/4.import-export.md b/content/3.content/4.import-export.md index 9109122c..f4e8db93 100644 --- a/content/3.content/4.import-export.md +++ b/content/3.content/4.import-export.md @@ -4,4 +4,63 @@ description: # Import & Export - +The content module allows importing and exporting of multiple items stored as files. + +## Import Items + + + +To import Items from a file, navigate to the collection and click "Import / Export" in the sidebar. Click into the import search box. A file browser will open. Once a file has been selected, click on "Start Import" to import the items. + +The items will now be in the collection, and the file itself will not be stored in the Directus project. + +::callout{type="info" title="Importing Relational Files"} + +It is possible to import relational field values as well. For this task, the user performing the import will need access +permissions for the related collection. + +:: + +## Export Items + + + +When exporting items, the export items menu provides granular control over exactly which items and +fields are exported, how they are exported, and where they are exported. + +To export items, follow the steps below, navigate to the desired collection and select "Import / Export" from the sidebar. Click on **"Export Items"** and the export items menu will appear. Select the desired format from CSV, JSON, XML, or YAML and click :icon{name="material-symbols:download-for-offline"} to download the file. + +## Export Items Menu + + + +This menu provides granular control over exactly which Items and Fields are exported, how they are exported, and where +they are exported. + +- **Format** — Choose to export Items as CSV, JSON, XML, or YAML. +- **Limit** — Set the maximum number of Items to be exported. +- **Export Location** — Download the export file directly to your machine or to the File Library. +- **Folder** — Choose the Folder to download to _(if export location is the Folder Library)_. +- **Sort Field** — Choose Field to sort Items by. +- **Sort Direction** — Choose to sort Items in ascending or descending order. +- **Full-Text Search** — Limit exported Items to ones which matched as search results. +- **Filter** — Limit exported Items with a Filter. +- **Fields** — Add, remove, and re-order the Item Fields that will be exported. + +## File Assets and Media + +Some Collections may directly or relationally include Fields referencing images, videos or other file types. It is not +possible to import or export files with this utility. + +To import and export files, please see the [File Library Module](/user-guide/file-library/files). + +::: tip What does Import/Export do in the File Library?! + +Import/Export handles Field Values associated with the file _(e.g. id, title, description, etc.)_. + +::: diff --git a/content/3.content/6.content-versioning.md b/content/3.content/6.content-versioning.md index 91f2c4be..3d13ce6e 100644 --- a/content/3.content/6.content-versioning.md +++ b/content/3.content/6.content-versioning.md @@ -1,5 +1,67 @@ --- -description: +description: This guide covers the process of enabling and utilizing Content Versioning in Directus. --- # Content Versioning + +Content versioning allows teams to create and manage different versions of their content. There are several reasons to +use content versioning, including drafting content without publishing it, and more ways to collaborate effectively. + +## Concepts + +- **Version**: a version is a snapshot of the differences between the original item and the created version. Each +- version represents a set of future changes to be applied to the item. +- **Main**: the main version is the original version of a piece of content that has been created and published. It is +- the default version that is displayed to users. The main version is the "source of truth" for all other versions. +- **Promote**: promoting a version means to make it the new main version. When a new version is promoted, it becomes + the main version that is displayed to users, and it replaces the previous main version. + +## Setting Up Content Versioning + + + +Navigate to **Settings** > **Data Model**, select the collection that you want to enable content versioning for, and scroll down to the content versioning section. Toggle "Enable Versions" and save your data model. + +## Creating a New Version + + + +Open an item within your versioned collection. At the top of the item view, you will notice a dropdown with the main Content Version displayed as "main". Select "Create Version" and provide a key and a name for the new version. You can then save your new version. + +::callout{type="info" title="Version Source"} + +All new versions originate from the main version. This implies that the main version acts as the single source of truth +for other versions. + +:: + +## Making Changes to a Version + + + +Open the item in the newly created version, and make the desired edits to the item's content. + +Upon saving the changes, you'll notice that the main version remains unaffected, while the changes are reflected only in the modified version. + +## Reviewing and Promoting a Version + +Promoting a version will turn it into the main version. + +Open the version you want to promote and select the "Promote Version" option from the dropdown. In the "Changes" tab, you can review all the changes made in the version and decide which changes to accept or reject. Switch to the "Preview" tab to see a preview of the changes you are about to promote. + +After promoting a version, you can choose to keep or delete the version. + +::callout{type="info" title="Programmatically Implement Content Versioning"} + +You have the option to integrate Content Versioning through the API. To learn how to accomplish this, please refer to +our [API reference documentation](/api-reference/system/versions). + +:: + +## Revisions and Content Versioning + +Under the hood, content versions are stored in the `directus_revisions` collection. In bigger projects this collection +can get large. + +Some Directus users combat this by periodically purging some or all data in this collection. Be aware that this could +unintentionally purge content versions. From c9becb6c7a7c1cd2336693cc5a026f1d293de735 Mon Sep 17 00:00:00 2001 From: Carmen Huidobro Date: Tue, 8 Oct 2024 16:31:05 +0200 Subject: [PATCH 02/27] Writeup --- content/3.content/3.layouts.md | 244 ++++++++++++++++++++++++++- content/3.content/4.import-export.md | 37 ++-- 2 files changed, 254 insertions(+), 27 deletions(-) diff --git a/content/3.content/3.layouts.md b/content/3.content/3.layouts.md index 17a1d1bb..125288d3 100644 --- a/content/3.content/3.layouts.md +++ b/content/3.content/3.layouts.md @@ -1,7 +1,247 @@ --- -description: +description: Learn to use layouts for viewing and interacting with items in a collection using Directus. --- # Layouts - +Layouts are customized displays for viewing and interacting with the items in a collection. + +## Adjust a Collection's Layout + + + +To adjust an item's layout, follow these steps. Navigate to the content and select the collection you wish to work with. In the page sidebar, click on "Layout Options". Then you can choose the desired layout type you want to use and customize it accordingly. + +::callout{type="warning" title="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. + +:: + +::callout{type="info" title="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. + +:: + +::callout{type="info" title="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. + +:: + +### 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. + + +## Table Layout + + + +This layout displays items in a tabular form, making it compatible with all kinds of items. This is the default +layout used in the content module. + +### 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 :icon{name="material-symbols:add-circle-outline-rounded"} in the page subheader and select the desired Field(s). +- **Remove Field** — Select :icon{name="material-symbols:arrow-drop-down-circle"} in the column title and click **"Hide Field"**. +- **Sort Items by Column** — Select :icon{name="material-symbols:arrow-drop-down-circle"} in the column title and sort ascending or + descending. +- **Set Text Alignment** — Select :icon{name="material-symbols:arrow-drop-down-circle"} 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 :icon{name="material-symbols:check-box-outline"} in the selection column header. + +### Page Area + +- **Select Item(s)** — Click :icon{name="material-symbols:check-box-outline"} in the selection column for the desired + Item(s). +- **Manually Sort Items** — Toggle :icon{name="material-symbols:check-box-outline"} in the configured Sort column to drag and drop + :icon{name="material-symbols:drag-handle"} Items. + +::callout{type="info" title="Manual Sorting Requires Configuration"} + +Only available if you [configure a sort field](/data-modeling/collections) in the collection's data model +settings. + +:: + +## Card Layout + + + +This tiled layout is ideal for collections that prioritize an image. 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 ":icon{name="material-symbols:check-circle"} Select All" in the selection column header. + +### Page Area + +- **Select Item(s)** — Click :icon{name="material-symbols: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). + +### 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. + +::callout{type="info" title="Configuration Requirements"} + +To use this layout, the collection will need at least one datetime [Field](/data-modeling/fields) 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. + +### 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 :icon{name="material-symbols:add-circle-outline-rounded"} 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](/app/data-model/fields) on the +Collection, then identify this Field under **"Group By"** in the Layout Options menu. + +::: diff --git a/content/3.content/4.import-export.md b/content/3.content/4.import-export.md index f4e8db93..aded3d13 100644 --- a/content/3.content/4.import-export.md +++ b/content/3.content/4.import-export.md @@ -31,36 +31,23 @@ permissions for the related collection. When exporting items, the export items menu provides granular control over exactly which items and fields are exported, how they are exported, and where they are exported. -To export items, follow the steps below, navigate to the desired collection and select "Import / Export" from the sidebar. Click on **"Export Items"** and the export items menu will appear. Select the desired format from CSV, JSON, XML, or YAML and click :icon{name="material-symbols:download-for-offline"} to download the file. +To export items, follow the steps below, navigate to the desired collection and select "Import / Export" from the sidebar. Click on "Export Items" and the export items menu will appear. Select the desired format from CSV, JSON, XML, or YAML and click :icon{name="material-symbols:download-for-offline"} to download the file. ## Export Items Menu -