Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions docs/en/01_basic_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,16 @@ class MyModel extends DataObject

## Unversioned links

The `Link` model has the [`Versioned`](api:SilverStripe\Versioned\Versioned) extension applied to it by default. If you wish for links to not be versioned, then remove the extension from the `Link` model in the project's `app/_config.php` file.
The `Link` model has the [`Versioned`](api:SilverStripe\Versioned\Versioned) extension applied to it by default. If you wish for links to not be versioned, then remove the extension from the `Link` model via YAML configuration.

```php
// app/_config.php

use SilverStripe\LinkField\Models\Link;
use SilverStripe\Versioned\Versioned;

Link::remove_extension(Versioned::class);
```yml
---
Name: app-link-customization
---
SilverStripe\LinkField\Models\Link:
extensions:
# This project uses non-versioned links
versioned: null
```

If you do this, you don't need to apply the `$owns` configuration described in [basic usage](#basic-usage) above.
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Link extends DataObject
private static $default_sort = 'Sort';

private static array $extensions = [
Versioned::class,
'versioned' => Versioned::class,
];

/**
Expand Down