strapi admin management panel content customization

I encountered a problem. My current strapi version is 4.16.2. I need to customize the /admin page, but I can’t find the source code entry. Does anyone know? Please give me some advice.

1 Like

Earlier you would have used PatchPackage to modify the admin pages, but since I think 4.15 they have only been including the compiled distribution in the @strapi package. This means that you’re going to need to create your own Homepage component in your own custom plugin, then write a middleware to redirect to that plugin homepage upon login.

I will say that I have personally been having issues with this, but this article was a good starting point:

The middleware functionality does not seem to work in Typescript the way its described in the article. The Strapi team needs to do a much better job of addressing the out of date documentation.

An example of this is in this documentation: admin-redirect | Strapi Documentation

I dont know about this vanilla javascript example, but trying to point the config.js file at my middleware redirector results in the failure to launch the project due to it not being able to find the file. Currently as of 4.20.4 I have to point the configuration for middlewares resolver to the …/dist/src/middlewares/{file} to get it to work. This seems wrong, but its the only way it works.

The other issue with this is that because the app is using useHistory hook for internal links, a direct route to /admin will get redirected where I want, but if you click on the brand link at the top of the left sidebar /admin will not redirect. Very annoying.

1 Like

Yes, in version 4.14 I can still modify the source code of strapi, but after 4.16 I can no longer find the entrance.