Robin S Posted January 14, 2021 Share Posted January 14, 2021 If your module has a lot of config fields you might want to divide them into groups inside a tabbed interface. Here is a demonstration module showing how this can be done. https://github.com/Toutouwai/ModuleConfigTabs Thanks to @kixe for providing my starting point in this forum topic. 11 Link to comment Share on other sites More sharing options...
MarkE Posted August 17, 2021 Share Posted August 17, 2021 InputfieldWrapper is not a module AFAIK - at least in my v 3.0.165 new InputfieldWrapper() works ok though. Link to comment Share on other sites More sharing options...
Robin S Posted August 18, 2021 Author Share Posted August 18, 2021 1 hour ago, MarkE said: InputfieldWrapper is not a module AFAIK - at least in my v 3.0.165 InputfieldWrapper extends Inputfield which implements Module. Do you get an error or something when you install this example module? Link to comment Share on other sites More sharing options...
MarkE Posted August 18, 2021 Share Posted August 18, 2021 7 hours ago, Robin S said: Do you get an error or something when you install this example module? Yes. If I put the same code as the above into the Tracy console on my system, it returns null. Link to comment Share on other sites More sharing options...
netcarver Posted August 18, 2021 Share Posted August 18, 2021 This requires a more recent version of PW than 3.0.165 - I'm currently using 3.0.182. 1 Link to comment Share on other sites More sharing options...
MarkE Posted August 18, 2021 Share Posted August 18, 2021 49 minutes ago, netcarver said: This requires a more recent version of PW than 3.0.165 - I'm currently using 3.0.182. Ta. The site is on 3.0.165. @Robin S's module is on 170. Hopefully a new core is out soon and I will move to that. However, I am using this in my ProcessDbMigrate module (full alpha release shortly.... ?) and I have tried to make that compatible with 3.0.148 (even pre page class days). I'm not sure what the best policy is regarding the backwards compatibility of new modules. Link to comment Share on other sites More sharing options...
MarkE Posted August 23, 2021 Share Posted August 23, 2021 For the benefit of anyone else wanting their module to be comptible with earlier versions of PW, I suggest you use: $tab1 = $this->wire(new InputfieldWrapper()); not $tab1 = $modules->get('InputfieldWrapper'); Also, do not use plain $tab1 = new InputfieldWrapper(); as the column widths of the contained inputfields will not work properly. Per the PW coding style guide: Quote All newly-created objects that are derived from Wire SHOULD have their dependencies injected. In order to do this, pass the new object through the wire() method. 2 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