You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default Tina doesn't provide any opinionated file name constraints. This is because most operating systems provide a variety of file name configurations and we didn't want users to be constrained. If you need to enforce file name constraints at the collection level, Tina provides a few options for you.
12
11
13
12
* Please be aware of the following limitations with Tina if you do decide to do decide to implement filename customisation using any of the methods below:
@@ -31,6 +30,12 @@ By default Tina doesn't provide any opinionated file name constraints. This is b
31
30
32
31
The `slugify` function is useful when you want to have a file name that is *derived* from other field(s) in your collection. For example: you could have a filename that is composed from `title` and `topic` and title fields in your collection.
33
32
33
+
<WarningCallout
34
+
body={<>
35
+
The slugify function is only applies constraints when the user creates new files. Users still have complete freedom when renaming a file.
36
+
</>}
37
+
/>
38
+
34
39
### Example with slugify and read only
35
40
36
41
```ts
@@ -75,12 +80,6 @@ export default defineConfig({
75
80
})
76
81
```
77
82
78
-
<WarningCallout
79
-
body={<>
80
-
The slugify function is only applies constraints when the user creates new files. Users still have complete freedom when renaming a file.
81
-
</>}
82
-
/>
83
-
84
83
### Example with default slugify
85
84
86
85
If no slugify function is provided and there is a field with `isTitle: true`. A default slugify function will be used that strips out every non-alphanumeric character and replaces spaces with dashes.
Using the parse function you can enforce file constraints within the Tina editor. The callback function you provide will be used to sanitise the user input while they're typing. For Example: you could use
0 commit comments