Last active
December 19, 2015 04:58
-
-
Save hubertusanton/5900547 to your computer and use it in GitHub Desktop.
Silverstripe 3.1 nice internal / external link field
This file contains hidden or 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
<?php | |
// nice internal / external link field | |
$fields->replaceField('LinkExteralOrInternal', (SelectionGroup::create( | |
"LinkExteralOrInternal", | |
array( | |
SelectionGroup_Item::create( | |
"external", | |
TextField::create( | |
"ExternalLink", | |
"Externe link" | |
), | |
'Externe link' | |
), | |
SelectionGroup_Item::create( | |
'internal', | |
TreeDropdownField::create( | |
"InternalLinkID", | |
"", | |
'SiteTree', | |
'ID', | |
'TreeTitle' | |
), | |
'Interne link' | |
) | |
) | |
) | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment