Jump to content

Site members as pages?


einsteinsboi
 Share

Recommended Posts

I know this has been discussed before and I've read through a lot of those threads over the past few months, but I'm getting myself all confused and have so many bookmarks my brain is at risk of exploding, so bear with me as I ask for some guidance/clarification.

I have a site with about 500 members that I'm moving to PW.  The old database is so convoluted that I'll be importing them manually, which is no big deal as the client is willing to provide plenty of data entry assistance if I need it  ^-^ Each member will have the basic role of "member" with sub-roles "junior", "senior", "elder", etc  Each role will be able to view different parts of the member end of the site.  This is all easy for me to set up using access by template rules.

Now this is where I'm sweating. I have a feeling it's easy but for some reason I keep confusing myself and probably complicating the whole thing  :undecided:

  • I would like very much to have each member profile be a page with different fields that I can pull into an aggregated members page for public viewing.  That's easy enough to do by me just creating the pages. But how do I then have each member be able to edit certain fields on their profile page and nothing else? I don't want them to be able to edit anything else on the site, just their profile page.  And this is what is really confusing me - how do I link the profile page to the members site account?
  • Also, if a new (junior) member joins using a form I will create (via Form Builder), I want a new page to be created for that user but remain unpublished until the client approves them .  

Again, I know the answers are here somewhere, and I'm sure they're really simple but I'm having major mental block at the moment  :huh:  :huh: 

Thanks for the help

Link to comment
Share on other sites

 I'm getting myself all confused and have so many bookmarks my brain is at risk of exploding,...

Mary, I am sure you will get some pointers here. Sorry I cant help. But I am so familiar with your <snipped> statement above. There must be a name for it...  :)

  • Like 1
Link to comment
Share on other sites

Since users are already simply pages under Admin->Access->Users, you probably won’t need to create separate profile pages. You can simply add more fields to the user template. All fields you add there will also apppear in the module configuration of the core module “User Profile”, where you can select those you want individual users to modify themselves.

If you still want to use separate pages, you can bind them to users by adding a page-field to the user template.

Hope this helps.

  • Like 2
Link to comment
Share on other sites

But how do I then have each member be able to edit certain fields on their profile page and nothing else? I don't want them to be able to edit anything else on the site, just their profile page. 

Jan's approach above would work but it is an all or nothing solution meaning, all members (irrespective of your 'sub-roles') will only be able to edit certain fields. If, however, you want say, Junior members to be able to edit fields A,B, Senior members A,B,D and Elder members A,B,C,D,E, then this approach would not work. For that you would probably need a module like 'Page Edit Field Permission' (Enables you to limit edit access (by role) to any field in the page editor.)

  • Like 2
Link to comment
Share on other sites

Since users are already simply pages under Admin->Access->Users, you probably won’t need to create separate profile pages. You can simply add more fields to the user template. All fields you add there will also apppear in the module configuration of the core module “User Profile”, where you can select those you want individual users to modify themselves.

If you still want to use separate pages, you can bind them to users by adding a page-field to the user template.

Hope this helps.

Thanks for the suggestion Jan. I have set up some demo users using the inbuilt user profile and added some custom field, but I think I need the separate profile page approach for the site manager to manage users in a way that will be easy to understand, and i think user profiles in the tree will probably be easier for her to follow.  The other problem I've had with the inbuilt user profile is trying to get a profile picture field to work, but I'm probably doing something wrong there.  I will try the page-field approach, I didn't know there was a page field :)

Jan's approach above would work but it is an all or nothing solution meaning, all members (irrespective of your 'sub-roles') will only be able to edit certain fields. If, however, you want say, Junior members to be able to edit fields A,B, Senior members A,B,D and Elder members A,B,C,D,E, then this approach would not work. For that you would probably need a module like 'Page Edit Field Permission' (Enables you to limit edit access (by role) to any field in the page editor.)

Thanks Kongondo.  All members regardless of sub-role need to be able to edit the same set of fields, where the access differs is in what parts of the website they can access.

Will give this a go :)

thanks for the replies

Link to comment
Share on other sites

....The other problem I've had with the inbuilt user profile is trying to get a profile picture field to work, but I'm probably doing something wrong there....

Image fields work the same as in any other template :-). What exactly went wrong?

Link to comment
Share on other sites

Image fields work the same as in any other template :-). What exactly went wrong?

I've created an image field.  I upload the photo, it says it's uploaded, but I don't see it.  I think I had this expectation that the profile photo would show in the backend after it's uploaded, like in other systems, so that when editing their profile the user can see what profile photo they have uploaded and how it will appear, and they can change it if needed. But I probably need to do some work to make that happen, don't I?

Still a lot of PW learning to go.  But all my clients want WP WP WP... meh.

Link to comment
Share on other sites

Seems something wrong with your settings. A photo should absolutely show (that's how it works in the Blog module - authors have profile photos).

That's what I thought...

Something says me you've chosen InputfieldFile and not InputfieldImage Mary.

Thanks Martijn, I've double checked and I definitely have Image as the input field. 

What I've now noticed is that if I'm logged in with the admin account I can upload a photo to a user's profile and it shows up immediately as expected, but I'm logged in as that user I can see the photo but I'm still not able to upload a new photo and replace the current one that the admin role uploaded. This isn't ideal because ideally the member should be uploading their own profile photo and be able to replace it. I have checked that I have allowed the member roles to be able to update password/profile.

Not sure why it's not working.

Link to comment
Share on other sites

This with the photos on user pages was discussed here before. But I do not remember a solution, only that people have created extra pages and bound them to the userpages, like Kongondo has said above.

https://processwire.com/talk/topic/5644-images-in-user-profile/ not necessary to read the whole thread, just scroll down to where ryan has posted and read the few posts around that.

You also may reopen the related issue at GitHub: https://github.com/ryancramerdesign/ProcessWire/issues/444

Edited by horst
added link to Github
  • Like 1
Link to comment
Share on other sites

This with the photos on user pages was discussed here before. But I do not remember a solution, only that people have created extra pages and bound them to the userpages, like Kongondo has said above.

https://processwire.com/talk/topic/5644-images-in-user-profile/ not necessary to read the whole thread, just scroll down to where ryan has posted and read the few posts around that.

You also may reopen the related issue at GitHub: https://github.com/ryancramerdesign/ProcessWire/issues/444

Thank you. I have reopened the issue on Github. I suspect what I will end up doing is created user profile pages separately and binding them to the user profile using the page-field as Jan recommended above, and see if that works better.  Was leaning towards that route initially

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

×
×
  • Create New...