I'm locally working on a Craft Plugin with a Page in the Control Panel where I have a form that posts to a controller.
<form action="/actions/import-products/product/create" method="POST" enctype="multipart/form-data"> ... </form>
The controller returns the following at the of it's action
// Render and return the plugin's 'index.twig' template return $this->renderTemplate('import-products/index.twig', $variables, View::TEMPLATE_MODE_CP);
However, after the renderTemplate, the CP navigation is broken. It seems that Craft is using the base URL to build the navigation items. Where it should be localhost/admin/dashboard, it's localhost/dashboard? How do I fix this?
Changing the Base URL of the site to localhost/admin breaks everything because the default routes are changed to localhost/admin/admin/dashboard.