Arcturus Posted October 19, 2013 Posted October 19, 2013 I'm trying to do a pair of seemingly simple things, given how the rest of Processwire works, but can't figure them out. 1) I've added the fields "firstname" and "lastname" to the User template and would like to list those values along with Name, E-Mail Address and Roles in the Admin > Access > Users table. There's a built-in option to do this for the user list in the page tree view... but not the place where you'd be doing your user management. I looked through the admin files and couldn't find where this list was being generated. 2) I'd like to change the label for the system name field from "Name" to "Username" for clarity purposes. Any suggestions?
horst Posted October 19, 2013 Posted October 19, 2013 (edited) Don't really know if it supports what you needs, but seems to be worth a look / try: http://processwire.com/talk/topic/3471-ability-to-sort-and-search-through-users-in-admin/#entry36481 https://github.com/apeisa/ProcessUserExtended/blob/master/ProcessUserExtended.module Edited October 19, 2013 by horst
Arcturus Posted October 20, 2013 Author Posted October 20, 2013 Thanks Horst, unfortunately that module only adds the same page tree view functionality that's already built into v2.3.
ryan Posted October 26, 2013 Posted October 26, 2013 Arcturus, Go to Modules > Process > Users. It should let you select what fields you want to be shown in the listing, and in what order. As for changing the name of the "name", I don't think you can do that short of going through a hook or using the multi-language translation system (and translating the default language value). If you want to do that, the file where it is located is /wire/modules/Process/ProcessPageType/ProcessPageType.module in the renderList() method. Of course, you could just change it directly in that file, but your change would get overwritten during upgrades, so you'd need to remember to change it again. 1
MrSnoozles Posted June 7, 2022 Posted June 7, 2022 @ryan Digging out a 9 year old topic: A common use case for me would be to sort users by `created`, so newest users are displayed first. Unfortunately the column `created` can not be selected in the module settings, as it's a system field. Neither can the default order be specified in the module configuration. Would that be something to consider for future updates?
Robin S Posted June 7, 2022 Posted June 7, 2022 55 minutes ago, MrSnoozles said: Unfortunately the column `created` can not be selected in the module settings, as it's a system field. Not sure why that is. Seems strange considering that system fields can be added by users in the Columns tab. You can use a hook to set the columns and default sort: $wire->addHookBefore('ProcessPageLister::execute', function(HookEvent $event) { /* @var ProcessPageLister $lister */ $lister = $event->object; // Only for Users lister if($lister->parent->id !== 29) return; // Include "created" in default columns $lister->columns = [ 'name', 'email', 'roles', 'created', ]; // Set default sort $lister->defaultSort = '-created'; // Optional: allow user to change sort but reset to default sort each time Access > Users is visited if(!$event->wire()->config->ajax) $lister->sessionSet('sort', ''); }); 2
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