Check out the module docs (docs/en/index.md) - my guess is
you'll be looking for the ManyManyPickerField...
Basically you'll need to update getCMSFields() on the DataObject
declaring the many_many_extraFields - and add a function to the
DataObject with the $belongs_many_many to return the actual picker
field.
Here's an example from one of my sites; where the many_many is
between AFLMatch & AFLPlayer. Essentially the example provides
a 'Give votes to Player per Match' interface. Votes is the
conceptual 'extra field' that goes into the join table.
HTH,
Rod.
// AFLMatch
public static $many_many = array(
'Votes' => 'AFLPlayer'
);
public static $many_many_extraFields = array(
'Votes' => array('NumberOfVotes' => 'Int')
);
public function getCMSFields() {
$fields = parent::getCMSFields();
$votesManyManyOptions = array(
'ExtraFields' => 'manyManyFieldSet',
);
$fields->addFieldsToTab('Root.Votes', array(
new ManyManyPickerField(
$this, 'Votes', 'Votes Awarded', array(
'ExtraFields' =>
'getCMSExtraFields',
'ShowPickedInSearch' => false,
'ExtraFilter' => '"TeamID" = ' .
$this->HomeTeamID . ' OR "TeamID" = ' . $this->AwayTeamID,
)),
));
$rounds = DataObject::get('AFLRound')->map('ID',
'RoundNumber');
$fields->addFieldToTab('Root.Main', new
DropdownField('AFLRoundID', 'Round Number', $rounds, '', null,
"None"));
$teams = DataObject::get('AFLTeam')->map('ID',
'TeamName');
$fields->addFieldToTab('Root.Main', new
DropdownField('HomeTeamID', 'Home Team', $teams, '', null, "No
Team"));
$fields->addFieldToTab('Root.Main', new
DropdownField('AwayTeamID', 'Away Team', $teams, '', null, "No
Team"));
return $fields;
}
// AFLPlayer
public static $belongs_many_many = array(
'Votes' => 'AFLMatch'
);
/**
* Used for ManyManyPickerField in AFLMatch
* @return FieldSet
*/
public function getCMSExtraFields() {
return new FieldSet(
new NumericField('NumberOfVotes', 'Votes Awarded')
);
}