21278 Posts in 5728 Topics by 2599 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 201 Views |
-
Silverstripe3 Dropdown multiselect

14 November 2012 at 12:56am
I want to have a multi select drop down menu so the Admin user can choose to show certain individuals on any Page.
page.php getCMSFields code
// get all existing individuals
$individuals = DataObject::get('Individual');
if (!empty($individualss)) {
// create an array('ID'=>'Name')
$map = $individuals->toDropdownMap('ID', 'FullName');
// create a Checkbox group based on the array
$fields->addFieldToTab('Root.IntroPanel',
new CheckboxSetField(
$name = "Individuals",
$title = "Select Contacts",
$source = $map
));I think this needs to be differnt in silverstripe3
$map = $individuals->toDropdownMap('ID', 'FullName');
I was thinking if this isn't posible maybe i could create a shortcode, but a shortcode would not be easier for the admin user.
-
Re: Silverstripe3 Dropdown multiselect

14 November 2012 at 1:07am
$map = $individuals->map('ID', 'FullName');
answered my own question
| 201 Views | ||
|
Page:
1
|
Go to Top |

