I have a FamilyPage and a dataobject "Jobs"
In FamilyPage I can create the DropDown:
function getCMSFields()
{
$fields = parent::getCMSFields();
$jobsob = DataObject::get('Jobs');
$fields->addFieldToTab('Root.Content.Band5', new DropdownField('JobTitle', 'Jobs', $Jobsob->map()));
The dropdown works, except it show every job in the dataobject (which it should).
I can manually get the correct ones using:
$jobsob = DataObject::get('Jobs', 'FamiliesID = 226'); // I know 226 is the ID of one of the FamilyPages
$fields->addFieldToTab('Root.Content.Band5', new DropdownField('JobTitle', 'Jobs', $Jobsob->map()));
How do I replace "FamiliesID = 226" with the ID of the FamilyPage that I am currently in?
Thanks,
Brian