benbyf Posted November 21, 2018 Share Posted November 21, 2018 For some unknown reason when you add an admin page as a child of one of the menu items e.g. Setup - the page doesn't appear in the Setup menu. I've had to do a hacker work around to make it work but was wondering what I needed to add to the module or page to make this happen, and what was the thinking behind this? As looking at the core code it looks as though this was done purposely. Thanks! Link to comment Share on other sites More sharing options...
dragan Posted November 21, 2018 Share Posted November 21, 2018 I'm not sure, but I was just quickly looking at two modules I've installed - apparently you can do it in two ways: In the module file itself, getModuleInfo(): public static function getModuleInfo() { return array( 'title' => 'myModule', 'version' => '0.1.1', 'nav' => array( array( 'url' => 'export/', 'label' => 'Export', 'icon' => 'arrow-right', ), array( 'url' => 'import/', 'label' => 'Import', 'icon' => 'arrow-left' ), array( 'url' => 'restore/', 'label' => 'Restore', 'icon' => 'reply' ) ) ); } taken from the great Migrator module (shortened) Or with a JSON file named ModuleName.info.json: { "title": "Module Name", "page": { "name": "db-backups", "parent": "setup", "title": "DB Backups" }, "nav": [ { "url": "backup/", "label": "New Backup", "icon": "plus-circle" }, { "url": "upload/", "label": "Upload", "icon": "upload" } ] } taken from Ryan's Database Backup module. 2 Link to comment Share on other sites More sharing options...
flydev Posted November 21, 2018 Share Posted November 21, 2018 1 hour ago, benbyf said: what I needed to add to the module or page to make this happen, and what was the thinking behind this? For modules, what @dragan said. Also in getModuleInfo(), you can add : 'page' => array( 'name' => 'mymodulepage', 'parent' => 'setup', 'title' => 'MyModulePage' ), Quote For some unknown reason when you add an admin page as a child of one of the menu items e.g. Setup - the page doesn't appear in the Setup menu. And how do you do that ? The reason is because the page added require a ProcessModule to be defined. Link to comment Share on other sites More sharing options...
benbyf Posted November 21, 2018 Author Share Posted November 21, 2018 Will give that a go, thanks @flydev and @dragan. Sorry I realised I was commenting on the wrong thing... with template admin and process added it shows up, but I wanted to simply add a link to an edit page for a page with a non-process template so that I could quickly edit settings on a page with lots of fields without having to make a whole process module to enable it... Link to comment Share on other sites More sharing options...
bernhard Posted November 21, 2018 Share Posted November 21, 2018 AOS has this feature: 3 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