DISCLAIMER: I can’t get this to work with bricks default form either. Hoping there might be a workaround with BricksForge
I have created a function in PHP to return an array of items to place into a form dropdown.
function getRelatedCompanyCrews() {
$myCrews = [];
array_push($myCrews, 'Hi1');
array_push($myCrews, 'Hi2');
return $myCrews;
}
Then in a select field, I am calling {echo:getRelatedCompanyCrews}. Unfortunately, the array then gets added to the dropdown as one entry that looks like this “Hi1, Hi2” instead of two entries “Hi1” and “Hi2”.
Here is a FB post in the Bricks Community about the issue as well. Redirecting...
It looks like the issue is that Bricks removed a hook (bricks_options_filter) that we could use to catch the actual dropdown and change the output to separate out the returned array to separate values.
Also is there a way to add a “value” to every entry?
Thanks for any help in advance!