Jump to content

Recommended Posts

Posted

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) ?

Posted

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. 

Posted

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.

  • Like 1

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...