Skip to content

Commit 7c8c61e

Browse files
docs: Added documentation to eject collections in firecms 3
1 parent f10c1fb commit 7c8c61e

File tree

5 files changed

+165
-1
lines changed

5 files changed

+165
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
---
2+
id: eject_collections
3+
title: Eject Collections. Balancing the Power of Code with the Flexibility of No Code for Collection Management
4+
sidebar_label: Eject Collections
5+
---
6+
7+
The **newest version of [FireCMS](https://app.firecms.co)**, version 3.0 allows you to fully manage the CMS in the Cloud without having to manage code, so you can create collections using our **UI to create any schema** you need.
8+
9+
Consider the Books collection from our [demo](https://demo.firecms.co). The collection includes fields such as Title, Subtitle, Authors, Rating, Category, etc. You can create this collection using the UI, and then manage it from the UI. Any text, dates, images, list of text or other fields that you may think of.
10+
11+
![edit_collection_in_ui](/img/docs/collections/eject_collections_book_collection.png)
12+
13+
But what if you need to **customize** the view **further**, or prefer to use code to create the collection? FireCMS allows you to do just that. You can start a customization process with our [quickstart guide](https://firecms.co/docs/customization_quickstart) and then upload it to the Cloud, using the same hosted app.
14+
15+
A common question we receive is how to import the code of a collection. It's as simple as navigating to the Schema Editor, clicking the Code button, and copying the generated code. You can then **eject the collection** and manage it directly from your codebase.
16+
17+
![edit_collection_code_button](/img/docs/collections/eject_collections_code_button.png)
18+
19+
Next, paste the copied code into your preferred Code Editor.
20+
21+
![edit_collection_code_button](/img/docs/collections/eject_collections_code.png)
22+
23+
:::important
24+
This feature is available across all plans, including free and plus subscriptions. We believe in the power of code and want to make it accessible to everyone.
25+
:::
26+
27+
In summary, the latest version of [FireCMS](https://app.firecms.co) provides a **seamless No Code experience** for managing your CMS. However, if you need to customize your CMS further, you can easily switch to a Code-based approach. All within a single app, [app.firecms.co](https://www.notion.so/e8af421701bb440ebcc4ef4ce265e9ad?pvs=21).
28+
29+
Here's the full code generated by the UI for the Books collection:
30+
```tsx
31+
import { EntityCollection } from "firecms";
32+
33+
const BooksCollection:EntityCollection = {
34+
id: 'books',
35+
name: 'Books',
36+
path: 'books',
37+
editable: true,
38+
icon: 'table_rows',
39+
group: '',
40+
properties: {
41+
title: {
42+
name: 'Title',
43+
validation: {
44+
required: true,
45+
},
46+
dataType: 'string',
47+
},
48+
subtitle: {
49+
dataType: 'string',
50+
name: 'Subtitle',
51+
},
52+
authors: {
53+
name: 'Authors',
54+
dataType: 'string',
55+
},
56+
average_rating: {
57+
dataType: 'number',
58+
name: 'Average Rating',
59+
},
60+
category: {
61+
name: 'Category',
62+
dataType: 'string',
63+
enumValues: [
64+
{
65+
id: 'drama',
66+
label: 'Drama',
67+
},
68+
{
69+
label: 'Education',
70+
id: 'education',
71+
},
72+
{
73+
label: 'Fantasy',
74+
id: 'fantasy',
75+
},
76+
{
77+
id: 'fantasy-fiction',
78+
label: 'Fantasy Fiction',
79+
},
80+
{
81+
label: 'Fiction',
82+
id: 'fiction',
83+
},
84+
{
85+
id: 'history',
86+
label: 'History',
87+
},
88+
{
89+
id: 'juvenile-fiction',
90+
label: 'Juvenile Fiction',
91+
},
92+
{
93+
id: 'philosophy',
94+
label: 'Philosophy',
95+
},
96+
{
97+
id: 'religion',
98+
label: 'Religion',
99+
},
100+
{
101+
label: 'Science',
102+
id: 'science',
103+
},
104+
{
105+
id: 'self-help',
106+
label: 'Self Help',
107+
},
108+
{
109+
id: 'travel',
110+
label: 'Travel',
111+
},
112+
],
113+
},
114+
created_at: {
115+
name: 'Created At',
116+
dataType: 'date',
117+
},
118+
description: {
119+
name: 'Description',
120+
dataType: 'string',
121+
},
122+
isbn10: {
123+
name: 'Isbn10',
124+
dataType: 'number',
125+
},
126+
isbn13: {
127+
name: 'Isbn13',
128+
dataType: 'number',
129+
},
130+
num_pages: {
131+
name: 'Num Pages',
132+
dataType: 'number',
133+
},
134+
published_year: {
135+
dataType: 'number',
136+
name: 'Published Year',
137+
},
138+
ratings_count: {
139+
name: 'Ratings Count',
140+
dataType: 'number',
141+
},
142+
spanish_description: {
143+
name: 'Spanish Description',
144+
dataType: 'string',
145+
},
146+
tags: {
147+
dataType: 'array',
148+
of: {
149+
dataType: 'string',
150+
editable: true,
151+
name: 'Tags',
152+
},
153+
name: 'Tags',
154+
},
155+
thumbnail: {
156+
dataType: 'string',
157+
url: true,
158+
name: 'Thumbnail',
159+
},
160+
},
161+
subcollections: [],
162+
}
163+
```

website/sidebars.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ module.exports = {
2525
"collections/text_search",
2626
"collections/dynamic_collections",
2727
"collections/entity_views",
28-
"collections/collection_groups"
28+
"collections/collection_groups",
29+
"collections/eject_collections"
2930
]
3031
},
3132
{
Loading
Loading
Loading

0 commit comments

Comments
 (0)