Admin Dashboard: Changing the original default homepage #242
Unanswered
m-bakoulis
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hi I made a simple plugin that loads a different page for each role, it has two html examples for With the The plugin checks if there is a html file in the plugin folder for the current role and if the current page is homepage swaps the default template with role.html function admin() {
Event::on('Vvveb\System\Core\View', 'compile', __CLASS__, function ($template, $htmlFile, $tplFile, $vTpl, $view) {
if ($template == 'index.html') {
$admin = Admin::current();
if ($admin) {
//use role name or role id which html format is available
$role = $admin['role'] ?? $admin['role_id'] ?? 'index.html';
$file = __DIR__ . DS . $role . '.html';
//check if role html available
if (file_exists($file)) {
$htmlFile = $file;
}
}
}
return [$template, $htmlFile, $tplFile, $vTpl, $view];
});
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi @givanz, I wish to change the original index of the admin dashboard homepage with something simpler like a welcome message with some simple instructions since the majority of admin users have very basic roles. Can you please guide me on how replace the original default homepage of the /admin/ ?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions