pppws Posted August 15, 2017 Share Posted August 15, 2017 hey there, i'm using processwire for the first time, so maybe it's a dumb question. but i'm trying to have an options field which values are the users of the processwire. i don't need the values to be displayed, it's just for the administration of the page. but each time a new user is created / a user is deleted the options field should be updated automatically. is something like that possible? Link to comment Share on other sites More sharing options...
abdus Posted August 15, 2017 Share Posted August 15, 2017 This is a perfect use case for Page Reference field. Create a new field from Setup > Fields > Add New. Give it a name. Set its type as Page Reference. Save. If you want to select a single user, specify so on the Details tab, Switch to Input tab, set input type to Select. (Optionally install InputfieldPageAutocomplete core module to enable input with auto-completion capabilities) From Selectable Pages, set template to user. Optionally, use Custom Find and specify template as user, and a role, or any other field you like. Add the field to a template. Inside your template file, you can get the user using $page->userFieldName 6 Link to comment Share on other sites More sharing options...
pppws Posted August 15, 2017 Author Share Posted August 15, 2017 well! that was easy. thanks alot. i didn't know that users are page references. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now