I am trying to output a set of icons (coming from a set of GuidePages), where I always want to show the 5 icons, but need to be able to select which ones apply to this particular page.
In the pages where I want to display them I am doing:
private static $many_many = array(
'GuidePages' => GuidePage::class
);
and
$source = GuidePages::get()->map('ID', 'Name');
$fields->addFieldToTab('Root.Main',CheckboxSetField::create('GuidePages','Select guide which apply', $source));
Which is fine and I can select the icons, but it will obviously only output the actual icons I have selected (ie 3 instead of all 5).
I am trying to find a way of always showing the 5, but being able to select the few that apply and loop all of them in the template (adding an active class to the selected ones).
It doesn't necessarily need to be a many_many or any relationship between the 2 sets of pages, if there is another easier way to do it...ie just putting the values into a DataList or something...