Change main page
Hey guys
I would like to know if it is possible to change the main page of the template to the home page. Currently the first page is the login page, I would like to change it to home.
Replies (1)
Hi,
I apologize for the delay in getting back to you. Modifying the existing Metronic Angular framework may be a quite complex.
The code for the dashboard page can be found in the file /src/app/pages/routing.ts. As shown below:
{
path: 'dashboard',
loadChildren: () =>
import('./dashboard/dashboard.module').then((m) => m.DashboardModule),
},
The dashboard is part of the app-routing module, which is protected by the AuthGuard, as shown in the file /src/app/app-routing.module.ts:
{
path: '',
canActivate: [AuthGuard],
loadChildren: () =>
import('./_metronic/layout/layout.module').then((m) => m.LayoutModule),
},
To modify the existing code, you need to extract the dashboard router from the current configuration. However, the layout.module
is essential for the dashboard layout.
One solution is to replicate the _metronic/layout/layout.module as _metronic/layout/dashboard-layout.module. Inside the dashboard-layout.module
, place only the dashboard route and its layout.
I hope this helps you in proceeding with the necessary modifications.
Thanks