Skip to content

Commit

Permalink
SlideImage - use TreeDropdownField (#151)
Browse files Browse the repository at this point in the history
fixes #150
  • Loading branch information
jsirish authored Jan 9, 2019
1 parent eb82d87 commit b89b5e4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/SlideImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use SilverStripe\AssetAdmin\Forms\UploadField;
use SilverStripe\Assets\Image;
use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Forms\TreeDropdownField;
use SilverStripe\ORM\DataObject;
use SilverStripe\Security\Permission;
use SilverStripe\Security\PermissionProvider;
Expand Down Expand Up @@ -139,10 +140,13 @@ public function getCMSFields()
);

// Page link
$fields->dataFieldByName('PageLinkID')
->setTitle(
_t(__CLASS__ . '.PAGE_LINK', "Choose a page to link to:")
);
$fields->replaceField(
'PageLinkID',
TreeDropdownField::create('PageLinkID', '', SiteTree::class)
->setTitle(
_t(__CLASS__ . '.PAGE_LINK', "Choose a page to link to:")
)
);

// Image
$image = UploadField::create(
Expand Down

0 comments on commit b89b5e4

Please sign in to comment.