Docs

v.Latest
Introduction
Core Concepts
Querying Content
Editing
Customizing Tina
Going To Production
Media
Drafts
Guides
Further Reference
File is Multiple Collections Error

This error occurs when a file is in multiple collections. This is usually caused by overlapping paths in in your collections or an error in a match property.

The common fix for this is updating or adding the match property to exclude or include certain files.

Example with exclude

// tina/schema.ts
export default defineConfig({
collections: [
{
label: 'Blog Posts',
name: 'posts',
path: 'content/posts',
// ..
},
{
label: 'Featured Posts',
name: 'featuredPosts',
path: 'content/posts/featured',
// ...
},
//..
],
// ...
})

The example configuration above would cause an overlap because the Blog Post collection will contain all of the files in the Featured Posts collection. This can be fixed by updating the match.exclude property on the Blog Posts collection to exclude all of the files in the Features Posts collection.

// tina/schema.ts
export default defineConfig({
collections: [
{
label: 'Blog Posts',
name: 'posts',
path: 'content/posts',
match: {
exclude: 'featured/**/**',
},
// ..
},
{
label: 'Featured Posts',
name: 'featuredPosts',
path: 'content/posts/featured',
// ...
},
//..
],
// ...
})

Example with include

An example of include could be if you only wanted to include files with a certain name. For example if you wanted to include all of the files in the content/posts directory that had the name index.

// tina/schema.ts
export default defineConfig({
collections: [
{
label: 'Blog Posts',
name: 'posts',
path: 'content/posts',
match: {
include: '**/**/index',
},
// ..
},
//..
],
// ...
})
Last Edited: January 1, 1970