-
Notifications
You must be signed in to change notification settings - Fork 70
add content versioning updates #547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
formfcw
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @JamesW1 ❤️
A few things to consider
|
|
||
| - **Version**: a version of an item is a snapshot that gets copied from the current version or main item, allowing you to safely make changes and later promote to be the main item. | ||
| - **Main**: the main item is the default item that is displayed to users. It is the "source of truth" for all versions. | ||
| - **Version**: A snapshot of an item that allows you to safely make changes without affecting the current version or main item. Versions can be promoted to become the new main item. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not a snapshot and we can’t make them from other versions atm.
| - **Version**: A snapshot of an item that allows you to safely make changes without affecting the current version or main item. Versions can be promoted to become the new main item. | |
| - **Version**: A version of an item that allows you to safely make changes without affecting the main item. Versions can be promoted to become the new main item. |
| - Shows as empty until you make edits | ||
| - Transforms from a virtual placeholder to an actual version when you save changes | ||
| - Uses "**draft**" as a reserved version key that cannot be used for custom versions | ||
| - Can be customized with a different display name, though it defaults to "Draft" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This not possible. "Draft" is always "Draft" or the translated "$t:draft" name of it. This way we avoid confusion when we select a draft from the version select menu.
| - Can be customized with a different display name, though it defaults to "Draft" |
|
|
||
| ::callout{icon="material-symbols:warning"} | ||
| **Backward Compatibility** | ||
| The reserved global "draft" version was introduced in Directus 11.15.0. If you previously had custom versions with the key "draft", they will be preserved with their current names but cannot be deleted. The reserved draft version will coexist with your existing draft versions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| The reserved global "draft" version was introduced in Directus 11.15.0. If you previously had custom versions with the key "draft", they will be preserved with their current names but cannot be deleted. The reserved draft version will coexist with your existing draft versions. | |
| The reserved global "draft" version was introduced in Directus 11.15.0. If you have an existing version with the key `draft` and a custom name other than “Draft”, the display name will be standardized to “Draft” (i.e. transformed) to support the new global versioning feature. The version content and functionality remain unchanged. |
| The Visual Editor integrates seamlessly with the draft version, allowing you to preview and edit changes in context: | ||
|
|
||
| 1. **Switch versions** using the dropdown in the Visual Editor header to toggle between "Main" and "Draft" | ||
| 2. **Edit items** that have content in the active version - items are only directly editable when they exist in the selected version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 2. **Edit items** that have content in the active version - items are only directly editable when they exist in the selected version | |
| 2. **Edit items** that have content in the active version – items are only directly editable when they exist in the selected version |
|
|
||
| ::callout{icon="material-symbols:info-outline"} | ||
| **Version-Aware Editing** | ||
| When working in a specific version like draft, only items that have content saved in that version will show edit affordances. Other items fall back to displaying their main version content without automatically creating new version entries. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let’s wait until the final implementation with this.
| our [API reference documentation](/api/versions). | ||
| :: | ||
|
|
||
| ## Configuring Visual Editor for Versions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ## Configuring Visual Editor for Versions | |
| ## Configuring Live Preview for Versions |
|
|
||
| ## Configuring Visual Editor for Versions | ||
|
|
||
| To enable version-aware previewing in the Visual Editor: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| To enable version-aware previewing in the Visual Editor: | |
| To enable version-aware previewing in the Live Preview: |
| To enable version-aware previewing in the Visual Editor: | ||
|
|
||
| 1. Navigate to **Settings** > **Data Model** and select your collection | ||
| 2. In the Visual Editor settings, configure your preview URL to include the `version` variable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 2. In the Visual Editor settings, configure your preview URL to include the `version` variable | |
| 2. In the Live Preview settings, configure your preview URL to include the `version` variable |
|
|
||
| 1. Navigate to **Settings** > **Data Model** and select your collection | ||
| 2. In the Visual Editor settings, configure your preview URL to include the `version` variable | ||
| 3. Example preview URL: `https://your-site.com/preview?item={{id}}&version={{version}}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A more realistic/classic example
| 3. Example preview URL: `https://your-site.com/preview?item={{id}}&version={{version}}` | |
| 3. Example preview URL: `https://your-site.com/{{slug}}?preview=true&version={{version}}` |
| 2. In the Visual Editor settings, configure your preview URL to include the `version` variable | ||
| 3. Example preview URL: `https://your-site.com/preview?item={{id}}&version={{version}}` | ||
|
|
||
| The Visual Editor will automatically pass the active version to your preview, allowing you to see draft changes in the context of your actual site layout. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| The Visual Editor will automatically pass the active version to your preview, allowing you to see draft changes in the context of your actual site layout. | |
| Live Preview will automatically pass the active version to your preview, allowing you to see draft changes in the context of your actual site layout. |
Note:⚠️ to be merged alongside 11.15.x release