Dashboard module
Permalink
Hi,
I'm playing around with C5 and like it. I'm now creating dashboard pages and that also works nice.
I've created a usergroup (students) and I gave them access to the dashboard with a custom dashboard page. All ok.
But when a 'student' logs in, he/she sees the default dashboard page with some statistics on it and that info isn't meant to be seen by the students. I want the students to see some other (important) info on the dashboard page (so I should use dashboard modules).
I know I can 'override' dashboard page, but is there another way by just saying "students may not see statistics" ?
(just curious)
I think I'll override the C5 dashboard page with some 'if' statements, but that is not very maintainable when there are some other groups (even from other packages)...
Any ideas?
(I hope that I'm clear in my story)
I'm playing around with C5 and like it. I'm now creating dashboard pages and that also works nice.
I've created a usergroup (students) and I gave them access to the dashboard with a custom dashboard page. All ok.
But when a 'student' logs in, he/she sees the default dashboard page with some statistics on it and that info isn't meant to be seen by the students. I want the students to see some other (important) info on the dashboard page (so I should use dashboard modules).
I know I can 'override' dashboard page, but is there another way by just saying "students may not see statistics" ?
(just curious)
I think I'll override the C5 dashboard page with some 'if' statements, but that is not very maintainable when there are some other groups (even from other packages)...
Any ideas?
(I hope that I'm clear in my story)
Hi, and just that I wrote this I just remembered/found out that there is also an event called 'on_user_login' from which you can control the redirection logic. :)
EDIT: And just to be clear, that event is fired AFTER your users have been successfully logged in, so only thing you need to worry about is redirecting the users to right place.
Here's some more info on how to extend the events if you're not already familiar with them:
http://www.concrete5.org/documentation/developers/system/events/...
EDIT2: If you need more help on extending the events, just tell so.
Antti / Mainio
EDIT: And just to be clear, that event is fired AFTER your users have been successfully logged in, so only thing you need to worry about is redirecting the users to right place.
Here's some more info on how to extend the events if you're not already familiar with them:
http://www.concrete5.org/documentation/developers/system/events/...
EDIT2: If you need more help on extending the events, just tell so.
Antti / Mainio
Thanx for the (fast!) replies.
I know how to extend the events, that shouldn't be a problem ;)
Is there any more information about the dashboard modules (or, dashboard page) so I can create another dashboard page with other info on it? I like the idea of the dashboard page, but not all groups need to see all ;)
I don't mean the 'normal' dashboard pages that are on the left (the single pages), I already created some. I mean the first dashboard page itself, with the statistics, notes, etc. on it.
S.
I know how to extend the events, that shouldn't be a problem ;)
Is there any more information about the dashboard modules (or, dashboard page) so I can create another dashboard page with other info on it? I like the idea of the dashboard page, but not all groups need to see all ;)
I don't mean the 'normal' dashboard pages that are on the left (the single pages), I already created some. I mean the first dashboard page itself, with the statistics, notes, etc. on it.
S.
What I'm getting (and hoping that the further development of c5 would be more transparent to others outside the core team), they're probably renewing currently the "dashboard module" logic and it will PROBABLY be replaced in 5.5 with "dashboard blocks" that would be more easily handled. This is just my feeling mixed up with some information from random topics from this forum/totally random/etc.
However, they're currently called dashboard modules and you can see an example how they are handled from /concrete/models/dashboard/homepage.php. Check out the output() method that outputs the dashboard module by its handle. So the magic function that outputs the module is:
You can find the modules from: /concrete/elements/dashboard/modules/ with their handles as their file names.
EDIT: For the controllers of these modules, check dir /concrete/controllers/dashboard/modules/
I have NEVER used them, this is just result of my investigation I just did on these.
And to your first question, you can probably exclude the single pages from the left-side dashboard navigation simply by adding a property to those pages. Set attribute "exclude_nav" to true.
Antti / Mainio
However, they're currently called dashboard modules and you can see an example how they are handled from /concrete/models/dashboard/homepage.php. Check out the output() method that outputs the dashboard module by its handle. So the magic function that outputs the module is:
Loader::dashboardModule($moduleHandle);
You can find the modules from: /concrete/elements/dashboard/modules/ with their handles as their file names.
EDIT: For the controllers of these modules, check dir /concrete/controllers/dashboard/modules/
I have NEVER used them, this is just result of my investigation I just did on these.
And to your first question, you can probably exclude the single pages from the left-side dashboard navigation simply by adding a property to those pages. Set attribute "exclude_nav" to true.
Antti / Mainio
I don't think you should be allowing them in the dashboard at all.
Make a singlepage (that is not in the dashboard) as giving them any access to the dashboard can pose a security risk.
Make a singlepage (that is not in the dashboard) as giving them any access to the dashboard can pose a security risk.
I'm creating a progression tracker for the students. I thought the dashboard was a nice place for them to see their scores.
Could also be done with single-pages I think. I was just thinking of the dashboard because all is setup already (styling and such).
But eventhough... a different 'dashboard-page' for different usergroups could be nice. Just for an example: not all groups need to know how many forms were received.
Just playing and trying the possibilities!
Could also be done with single-pages I think. I was just thinking of the dashboard because all is setup already (styling and such).
But eventhough... a different 'dashboard-page' for different usergroups could be nice. Just for an example: not all groups need to know how many forms were received.
Just playing and trying the possibilities!
You can apply the dashboard theme to singlepages on the site aswell with 2 lines of code
You can set permissions on the dashboard pages from the Sitemap view. Just in the UPPER RIGHT corner check the checkbox that says "Show System Pages". After this you can set permissions on the dashboard pages.
However, if "students" don't have permission to access the dashboard main page, they will be redirected to your site's main page instead of the dashboard. Therefore, you also need some logic after users are logged in to tell where they should be redirected. E.g. if group == students, redirect to dashboard/somepage, if group == admin, redirect to the statistics view (=dashboard main page).
You also probably already know that you can control the page where your users get redirected after login under Users and Groups => Login & Registration => Where to send users on login?
So you don't necessarily need to override any dashboard pages if you don't want to, you can just add a new single page that would have a controller to check where to send users on login. And then that page would be the page where users are redirected on login.
EDIT: Do not override the login.php, read my next post instead :)
However, in this situation I would probably override the controllers/login.php and do some changes in the finishLogin() method to check where to redirect your users. As said, this can also be achieved by creating a custom login page which you set as the page where users are redirected after login.
Br,
Antti / Mainio