Jump to content

Recommended Posts

Posted

Hello, I'm setting up a multi-author website, where for each Article I can have an author. Pretty basic. Since authors have their profile, I added multiple fields to the user template, such as image, first name, and so on. Now, in the Article template I would like to add the user as author, but I cannot find it in the fields suggestions. So I created an Author field letting me link the 'template' of selectable pages, not the parent, because I cannot find the Users in the suggestions provided. 

To make the long story short, I need in an Article page a dropdown for selecting a User. That's it

Thank you very much

Posted

In your page reference field’s settings under Input -> Selectable Pages -> Parent, you can select /admin/access/users. If you don’t specify anything else, that should make all users available for selection. You can of course narrow it down more by using the other settings.

I’m sure you’re aware that ProcessWire keeps track of which User created an Article page anyway. It may be a viable option for you to just use that (if the default behaviour doesn’t work for you, override $page->createdUser in a hook or enable editing the user through the advanced template options). Using the built-in user field should improve performance since it’s part of a Page’s basic data, not a regular field, and it may be more idiomatic, depending on what exactly you’re doing.

  • Like 2

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
  • Recently Browsing   0 members

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