Skip to content

Commit

Permalink
Merge pull request #59 from edwilde/patch-1
Browse files Browse the repository at this point in the history
Add example populate migration
  • Loading branch information
michalkleiner authored Apr 14, 2023
2 parents 28e0967 + 180b82b commit c4f33b3
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions docs/en/linkable-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down

0 comments on commit c4f33b3

Please sign in to comment.