Skip to content

Commit

Permalink
REFACTOR migrate to Silverstripe Link (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsirish authored Aug 14, 2024
1 parent 8f15bb5 commit 6e39397
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 21 deletions.
16 changes: 2 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Sponsors element for the [SilverStripe Elemental](https://github.com/dnadesign/s
## Requirements

* dnadesign/silverstripe-elemental ^5
* dynamic/silverstripe-elemental-baseobject ^4
* dynamic/silverstripe-elemental-baseobject ^5
* symbiote/silverstripe-gridfieldextensions ^4

## Installation
Expand All @@ -26,19 +26,7 @@ See [License](LICENSE.md)

## Upgrading from version 2

Elemental Sponsors drops `sheadawson/silverstripe-linkable` usage in favor of `gorriecoe/silverstripe-linkfield`. To avoid data loss, install the `dynamic/silverstripe-link-migrator` module as follows:

```markdown
composer require dynamic/silverstripe-link-migrator
```

Then, run the task "Linkable to SilverStripe Link Migration" via `/dev/tasks`, or cli via:
```markdown
vendor/bin/sake dev/tasks/LinkableMigrationTask
```

This will populate all of the new Link fields with data from the old class.

Elemental Sponsors drops `gorriecoe/silverstripe-linkfield` usage in favor of `silverstripe/linkfield`.

## Usage

Expand Down
7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
],
"require": {
"dnadesign/silverstripe-elemental": "^5",
"dynamic/silverstripe-elemental-baseobject": "^4",
"silverstripe/framework": "^5",
"dynamic/silverstripe-elemental-baseobject": "^5",
"symbiote/silverstripe-gridfieldextensions": "^4"
},
"require-dev": {
Expand All @@ -35,8 +34,8 @@
"config": {
"allow-plugins": {
"composer/installers": true,
"silverstripe/vendor-plugin": true,
"silverstripe/recipe-plugin": true
"silverstripe/recipe-plugin": true,
"silverstripe/vendor-plugin": true
},
"process-timeout": 600
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@
<% loop $SponsorsList %>
<div class="col-md-3 card sponsors__list__sponsor">
<% if $Image %>
<% if $ElementLink.LinkURL %><a href="$ElementLink.LinkURL"<% if $ElementLink.OpenInNewWindow %> target="_blank"<% end_if %> title="Go to $Title.ATT"><% end_if %>
<% if $ElementLink.URL %><a href="$ElementLink.URL" title="$ElementLink.Title"<% if $ElementLink.OpenInNew %> target="_blank" rel="noopener noreferrer"<% end_if %>><% end_if %>
<img src="$Image.Pad(576,576).URL" class="img-fluid card-img-top" alt="$Title.ATT"><% end_if %>
<% if $ElementLink.LinkURL %></a><% end_if %>
<% if $ElementLink.URL %></a><% end_if %>
<div class="card-body">
<% if $Title && $ShowTitle %><h3 class="card-title">$Title</h3><% end_if %>
<% if $Content %><div class="card-text">$Content</div><% end_if %>
<% if $ElementLink %><p>$ElementLink</p><% end_if %>
</div>
\ </div>
<% if $MultipleOf(4,1) && not Last %>
Expand Down

0 comments on commit 6e39397

Please sign in to comment.