froot Posted September 8, 2022 Posted September 8, 2022 how can I add a shortcut to my module or my module's settings page (which is the same in my case, I think) inside /admin/setup/ (dropdown) ?
bernhard Posted September 8, 2022 Posted September 8, 2022 Post from 2011 and still valid... how crazy/great is that?! 1
froot Posted September 8, 2022 Author Posted September 8, 2022 maybe I made myself not too clear or I'm not getting something very basic. I want to have a link inside the /admin/setup/ dropdown menu that brings me to my modules settings page. My module extends class WireData implements Module, ConfigurableModule, so the settings of the module are defined in an array of different fields in a separate php file outside the module's class. If I click on the module or on "Settings" just where the module is in the modules list, it brings me right where I want to be. I just want this page easier accessible.
bernhard Posted September 9, 2022 Posted September 9, 2022 Yes, just create an admin page like shown in the link I posted above and in the add this method to your ProcessModule: <?php public function execute() { $this->wire->session->redirect('urlofyourmoduleconfig'); } So if someone clicks on the link in the menu pw will execute the execute() method which will cause the redirect to your destination. 1
froot Posted September 9, 2022 Author Posted September 9, 2022 1 hour ago, bernhard said: ->redirect('urlofyourmoduleconfig') this works fine: $modules->getModuleEditUrl($className); 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