Jump to content

Template for custom admin page


Recommended Posts

I created custom admin page with link in top menu and set template for it. But opening it has another admin theme, not like is used in core admin pages.
So here is two screen shots. 
Does anybody know how to solve it.
And one more thing)) I included just small peace of code in this custom template for my admin page:

namespace ProcessWire;
require($config->paths->adminTemplates . 'controller.php'); 

Thanks for advice!



Link to comment
Share on other sites

3 hours ago, LostKobrakai said:

Why do you even include the old admin theme? 

I just copied contents of file admin.php in templates directory
Even if i write:

require($config->paths->modules . 'AdminTheme/AdminThemeDefault/controller.php');   

Result is the same.

Link to comment
Share on other sites

  • 2 years later...

I'm having the exact same problem. The intention to use a custom template for the job is to have additional fields together with the custom process. I also just copied / required the original admin.php template file. I thought it would make sense but it seems like this is not an option? Can you please shed some light on this @ryan

Link to comment
Share on other sites

  • 5 months later...

Same problem, copying the admin.php template to create a a custom admin template with additional fields does not work unfortunately. The old admin theme steps in.

Found a possible reason for this bug, but no way to fix it yet. The problem could rely in line 140 in core/admin.php:

$initFile = $config->paths->adminTemplates . 'init.php'; 

With the default site/templates/admin.php file that value points to: /wire/modules/AdminTheme/AdminThemeUikit/init.php
When using a custom admin template the value points to: /wire/templates-admin/init.php
which then loads the wrong files.


Link to comment
Share on other sites

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

  • Create New...