Skip to content

Commit

Permalink
Merge pull request #131 from muskie9/refactor/pageLinkField
Browse files Browse the repository at this point in the history
REFACTOR page link field to tree dropdown if not
  • Loading branch information
muskie9 authored Dec 5, 2017
2 parents c80609c + de09097 commit ccac22e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion code/SlideImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,13 @@ public function getCMSFields()
}

if($link = $fields->dataFieldByName('PageLinkID')){
$link->setTitle("'Choose a page to link to:'");
if(!$link instanceof TreeDropdownField){
$fields->replaceField(
'PageLinkID',
$link = TreeDropdownField::create('PageLinkID', null, SiteTree::class)
);
}
$link->setTitle("Choose a page to link to:");
}

if($image = $fields->dataFieldByName('Image')){
Expand Down

0 comments on commit ccac22e

Please sign in to comment.