Giter Site home page Giter Site logo

Comments (4)

aurooba avatar aurooba commented on May 29, 2024 1

I'd also suggest that instead of a search and a checklist of users:

Screen Shot 2022-02-04 at 7 33 28 PM

A token multiselect control is used. It essentially works the way the Tags control works in the Block Editor, but as you type, it shows you a dropdown of users matching what you're typing, and then you can select, remove, etc.

token-multi-select-control

from simple-user-listing.

helgatheviking avatar helgatheviking commented on May 29, 2024 1

Ok! Latest block iteration under development

Current status: show all users in the editor using the core data store and show all users on the frontend using existing shortcode. Absolutely no UI for modifying query yet.

cc @jonathanbossenger

from simple-user-listing.

helgatheviking avatar helgatheviking commented on May 29, 2024

👋 @aurooba

SUL supports most of the parameters of the WP_User_Query class as parameters for the shortcode.

Here's everything that currently is supported:

'query_id' => 'simple_user_listing', // This allows for targeted filtering of pre_get_user which allows for very custom queries.
'role' => '', // Multiple roles can be defined in a comma separated list [userlist role="infield,outfield"]
'role__in' => '', // Multiple roles can be defined in a comma separated list
'role__not_in' => // Multiple roles can be defined in a comma separated list
'include' => '', // Multiple user IDs can be defined in a comma separated list
'exclude' => '', // Multiple user IDs can be defined in a comma separated lis
'blog_id' => '',
'number' => get_option( 'posts_per_page', 10 ),
'order' => 'ASC',
'orderby' => 'login',
'meta_key' => '',
'meta_value' => '',
'meta_compare' => '=',
'meta_type' => 'CHAR',
'count_total' => true,
'template' => 'author' // Corresponds to content-author.php template, can accept different templates per shortcode.

Technically you can combine those to get fairly complex queries, ie: users with role "author" that have a billing address in Illinois, but I definitely think we should start as simply as possible.

The Figma is a lot incomplete, but also not a terrible starting place. I think there needs to be 2 parts.. maybe block and sidebar. The block should handy the query and the sidebar the resulting parts to be displayed

Query
Show all
Include specific users
Exclude specific users
Include specific roles
Exclude specific roles
Number of users (per page?)
Order/Orderby

Currently unsure if include and exclude should be mutually exclusive. If I recall.. that's what I was going for in the Figma... exclude is toggle one way and Include is the other.

I do want it so that eventually you can build up a complex query. Technically you current can say get all Authors except Kathy and Aurooba.. which is a combo of multiple args.

There's also a possible "what should we show about each author" in the sidebar section. This might be a later phase thing though.

Sidebar Display

User display name
Username vs display name vs first/last names
user avatar
link to profile page
hide/show search?

Ok that's enough thinking for today!

from simple-user-listing.

aurooba avatar aurooba commented on May 29, 2024

Notes:

Initial block placeholder can show 3 options:

  1. Show all users
  2. Show users by x role (show dropdown of roles)
  3. Select custom users.

from simple-user-listing.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.