Jump to content

I want to have a front-end dashboard for each registered user


adrianmak
 Share

Recommended Posts

There is dashboard for back-end admin.

How about a dashboard for front-end user ?

look like

http://www.mydomain.com/dashboard/[0-9]

When a user registered from front-end, instead of a new user account created, the user could access his/her own dashboard at

http://www.mydomain.com/dashboard/22

where 22 is the user account page id

Then I could add whatever in the dashboard

like order history for a e-commerce site

Link to comment
Share on other sites

ProcessWire does not separate backend and frontend user, it's up to you if you allow a user to access the backend.

So the frontend dashboard could work like this:

  1. The user registers on the frontend and you create a ProcessWire user with all given information. This will also assign a unique ID to the user object.
  2. Create a template "dashboard" where you grab the user-ID via urlSegment1
  3. Display any stuff you want in this template

Cheers

  • Like 3
Link to comment
Share on other sites

  1. Create a template "dashboard" where you grab the user-ID via urlSegment1

Assuming that each user should have access only to his own account/ content, there is no need to work with UrlSegments since you have access to the $user API. The output of example.org/dashboard/ can be individually to each user.

Example:

  1. Create a role 'frontenduserrole' without any permission.
  2. Create a template  dashboard and a file dashboard.php like
if ($user->isLoggedin() && $user->hasRole('frontenduserrole')) {
 echo "Welcome back $user->name";
}
else echo "You need to login first.";
  • Like 3
Link to comment
Share on other sites

I made something like your original idea:

A website with members which are also sorted into groups. Then the url of a members dashboard is like

http://website.com/groups/group34/member123

The structure:

root
 |--groups
 |   |--group
...  |    |--member
     |    |--member
     |--group
     |    |--member
     |    |--member
     |    |--member
    ...  ...

... But I am not sure if I still like that approach very much ^^

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...