PWaddict Posted April 24, 2021 Posted April 24, 2021 Hi. I would like to display on the lister the values instead of the titles from a specific options field. Can anyone please help with the hook?
elabx Posted April 24, 2021 Posted April 24, 2021 wire()->addHookAfter('FieldtypeOptions::markupValue', function($e){ $page = $e->arguments(0); $e->return = $page->select_options_field->id; }); 2
PWaddict Posted April 24, 2021 Author Posted April 24, 2021 Thanks for the hint @elabx Your code makes ALL options fields available in the Lister columns to display the same values. Here is how I did it: $wire->addHookAfter('FieldtypeOptions::markupValue', function($event) { if($this->process != 'ProcessPageLister') return; $field = $event->arguments(1); $value = $event->arguments(2); if($field == "my_options_field") { $event->return = $value->value; } }); 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now