dragan Posted February 16, 2019 Share Posted February 16, 2019 I wonder if it is possible to customize the inputfield selector: It's working fine as is, but when you click on "matches the following pages", the modal shows columns which sometimes don't make sense (e.g. if I select template=basic_page, I get fields first_name + last_name). That was probably my column selection I made the last time I used the default Finder Lister. Are those stored in cookies or sessions? It would be nice to define preview-columns in the field instance itself, after the initial selector definition. Someone got an idea? Link to comment Share on other sites More sharing options...
Robin S Posted February 17, 2019 Share Posted February 17, 2019 It looks like there are many settings that can be defined for InputfieldSelector, but only initValue can be set via the FieldtypeSelector field config. For the others you have to use a hook. The previewColumns setting controls the columns shown: $wire->addHookBefore('InputfieldSelector::render', function(HookEvent $event) { /* @var InputfieldSelector $inputfield */ $inputfield = $event->object; // Only for the FieldtypeSelector field of the given name if($inputfield->hasField != 'test_selector') return; // Define the columns you want $inputfield->previewColumns = ['name', 'template', 'modified']; }); 3 Link to comment Share on other sites More sharing options...
dragan Posted February 20, 2019 Author Share Posted February 20, 2019 @Robin S Sorry for the late reply: Your solutions works perfectly. Thanks! 1 Link to comment Share on other sites More sharing options...
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