References
Properties that handle how references are handled when creating new documents.
There are two cases in which Stackbit needs to know how to handle presets when new content is created:
- Creating documents from presets
- Duplicating existing pages
In both cases, Stackbit needs to know how to handle referenced content. By default, Stackbit will not create new documents, but will reuse the references. This behavior can be configured.
Reference Behavior
These properties determine how Stackbit handles references when new documents are created from existing documents or using presets.
duplicatableModels
When referenceBehavior
is set to copyReference
, this field specifies a list of exceptions.
1
2
3
4
5
- If a model appears in this list, it will be duplicated. All other models respect the
copyReference
setting.
nonDuplicatableModels
When referenceBehavior
is set to duplicateContents
, this field specifies a list of exceptions.
1
2
3
4
5
- If a model appears in this list, it will NOT be duplicated. All other models respect the
duplicateContents
setting.
referenceBehavior
Specifies how to handle references when creating new content containing a reference.
1
2
3
4
- This affects only newly-created presets. Changing this value (or adjusting the exceptions below) have no affect on existing content created from presets. This is because preset configurations are stored as files and Stackbit will not adjust existing files in your repository.
- Example: A
PostFeed
component preset includes a reference to a list of featured posts.copyReference
: New content created from the preset will refer to the same posts stored in the preset.duplicateContents
: Each post referenced in the preset will be duplicated, and the new posts will be used for the new content.