-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from edwilde/patch-1
Add example populate migration
- Loading branch information
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,6 +73,59 @@ If you use the populate module, you will not be able to simply "replace" the nam | |
new Linkfield module are quite different. There are entirely different models for different link types, whereas before | ||
it was just a DB field to specify the type. | ||
|
||
See below for example before/after usage: | ||
|
||
#### Before | ||
|
||
```yml | ||
Sheadawson\Linkable\Models\Link: | ||
internal: | ||
Title: Internal link | ||
Type: SiteTree | ||
SiteTreeID: 1 | ||
external: | ||
Title: External link | ||
Type: URL | ||
URL: https://example.org | ||
file: | ||
Title: File link | ||
Type: File | ||
File: =>SilverStripe\Assets\File.example | ||
phone: | ||
Title: Phone link | ||
Type: Phone | ||
Phone: +64 1 234 567 | ||
email: | ||
Title: Email link | ||
Type: Email | ||
Email: [email protected] | ||
``` | ||
#### After | ||
```yml | ||
SilverStripe\LinkField\Models\SiteTreeLink: | ||
internal: | ||
Title: Internal link | ||
Page: =>Page.home | ||
SilverStripe\LinkField\Models\ExternalLink: | ||
external: | ||
Title: External link | ||
ExternalUrl: https://example.org | ||
SilverStripe\LinkField\Models\FileLink: | ||
file: | ||
Title: File link | ||
File: =>SilverStripe\Assets\File.example | ||
SilverStripe\LinkField\Models\PhoneLink: | ||
phone: | ||
Title: Phone link | ||
Phone: +64 1 234 567 | ||
SilverStripe\LinkField\Models\EmailLink: | ||
email: | ||
Title: Email link | ||
Email: [email protected] | ||
``` | ||
## Replace template usages | ||
Before: You might have had references to `$LinkURL` or `$Link.LinkURL`. | ||
|