Docs updates

This commit is contained in:
Ben Haynes
2020-10-02 12:14:33 -04:00
parent e5a1c62ae9
commit ccdb296a92
4 changed files with 92 additions and 40 deletions

View File

@@ -83,40 +83,6 @@ const sections: Section[] = [
to: '/docs/guides',
default: 'readme',
children: [
{
name: 'Data Model',
to: '/docs/guides/fields',
children: [
{
name: 'Standard Field',
to: '/docs/guides/fields/creating-a-standard-field',
},
{
name: 'Presentation Field',
to: '/docs/guides/fields/creating-a-presentation-field',
},
{
name: 'Many-to-One Field',
to: '/docs/guides/fields/creating-a-many-to-one-field',
},
{
name: 'One-to-Many Field',
to: '/docs/guides/fields/creating-a-one-to-many-field',
},
{
name: 'Many-to-Many Field',
to: '/docs/guides/fields/creating-a-many-to-many-field',
},
{
name: 'Many-to-Any Field',
to: '/docs/guides/fields/creating-a-many-to-any-field',
},
{
name: 'Translated Fields',
to: '/docs/guides/fields/creating-translated-fields',
},
],
},
{
name: 'Extensions',
to: '/docs/guides/extensions',
@@ -161,7 +127,11 @@ const sections: Section[] = [
},
{
name: 'Collections',
to: '/docs/guides/creating-a-collection',
to: '/docs/guides/collections',
},
{
name: 'Fields',
to: '/docs/guides/fields',
},
{
name: 'Presets & Bookmarks',

View File

@@ -376,6 +376,11 @@ export default defineComponent({
&-title {
font-weight: bold;
margin-bottom: 0.5em;
}
&-body {
margin-top: 0.5em;
}
&.tip {

View File

@@ -5,7 +5,7 @@
## Creating a Collection
1. Navigate to **Settings > Data Model**
2. Click the **Create Collection** ("+") action button in the header
2. Click the **Create Collection** action button in the header
3. Enter a unique **Collection Name**, keeping in mind that this is entered as a _key_ that determines the database table name, and is then presented in the App using the [Title Formatter](#).
4. Optional: Configure the collection's **Primary Key** name and type.
* Auto-Incremented Integer
@@ -52,11 +52,33 @@ Keep in mind that Directus Collections are just a database tables. Therefore you
The archive feature allows you to enable the collection with a custom soft-delete option. Soft-delete allows users to remove items from the App, but maintains the actual database record for easy recovery.
* **Archive Field** — The field that will determine the
* **Archive App Filter**
* **Archive Value**
* **Unarchive Value**
* **Archive Field** — The field that holds the archive value
* **Archive App Filter** Allows users to view archived items
* **Archive Value** The value saved in the Archive Field when archived
* **Unarchive Value** The value saved in the Archive Field when unarchived
:::warning API Responses
Items that have been archived are still returned normally via the API. It is up to you to filter them out as needed.
:::
::: Status Field
When creating a new Collection, you have the option of creating an optional "Status" field. If you choose to include this field, the collection's archive settings will automatically be configured for you.
:::
### Sort
The sort feature enables manual drag-and-drop item reordering within the Directus App. This is typically shown on the [Item Browse](#) page/modal, and can also be used for sorting items within a [Junction Table](#).
::: Sort Field
When creating a new Collection, you have the option of creating an optional "Sort" field. If you choose to include this field, the collection's sort settings will automatically be configured for you.
:::
## Deleting a Collection
1. Navigate to **Settings > Data Model > [Collection Name]**
2. Click the red **Delete Collection** action button in the header
3. Confirm this decision by clicking **Delete** in the dialog
:::danger Irreversible Change
This action is permanent and can not be undone. Please proceed with caution.
:::

55
docs/guides/fields.md Normal file
View File

@@ -0,0 +1,55 @@
# Fields
> TK
## Creating a Field
1. Navigate to **Settings > Data Model > [Collection Name]**
2. Under Fields & Layout, click the **Create Field** button
3. **Choose the field type**, and follow its specific setup guide...
* [Standard Field](#)
* [Presentation Field](#)
* [Many-to-One Field](#)
* [One-to-Many Field](#)
* [Many-to-Many Field](#)
* [Many-to-Any Field](#)
* [Translated Fields](#)
::: Database Fields
Keep in mind that Directus Fields are just a database columns. Therefore you can import or create a column directly in the database, and it will automatically appear within Directus. The first time you manage that column, a `directus_fields` record will be created with default values.
:::
## Duplicating a Field
1. Navigate to **Settings > Data Model > [Collection Name]**
2. Click the **More Options** icon for the field you want to delete
3. Click the **Duplicate Field** option
## Adjusting Field Layout
The layout of the collection's form is determined by the following field options.
* **Field Visibility** — If the field is "Visible" or "Hidden"
* **Field Width** — How wide the field is shown relative to the form/page
* Half — The field is shown at half the form width
* Full — (Default) The field is shown at the full form width
* Fill — The field is shown filling the page width
* **Field Sort** — The order of fields within the form
* **Field Group** — If the field is a "group" type
1. Create any desired groupings by **[Creating a Field Group](#)**
2. Click the **More Options** icon for any fields/groups to adjust visibility
3. Click the **More Options** icon for any fields to adjust width
4. **Rearrange fields and groups** with their drag-and-drop handles
## Deleting a Field
1. Navigate to **Settings > Data Model > [Collection Name]**
2. Click the **More Options** icon for the field you want to delete
3. Click the **Delete Field** option
4. Confirm this decision by clicking **Delete** in the dialog
:::danger Irreversible Change
This action is permanent and can not be undone. Please proceed with caution.
:::