Users running a non-download version of Vanilla (pulled from github), on branch release/2019.016 or master from the last 2 weeks should upgrade to release/2019.017 or latest master for security reasons. Downloaded official open sources releases are not affected.
Please upgrade here. These earlier versions are no longer being updated and have security issues.

How can I set the default sort column and order?

This discussion is related to the Members List Enhanced addon.

Awesome plugin. Thanks for keeping this updated, @vrijvlinder!

Looking to customize this more for my site.

Let's say I want the members list table to default to sorting to "Last Visit" to be sorted by most recent visits. How can I go about doing that?

Comments

  • hgtonighthgtonight ∞ · New Moderator

    The sort order is set in the view. Line 15.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

    PFAFF
  • That worked perfectly. Thanks, @hgtonight!

  • Strange, I see the default field to sort is Name, and even see that in the URL but no matter what I do it doesn't change what's displayed on the page, and the names don't even appear sorted...

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    @rkleemann said:
    Strange, I see the default field to sort is Name, and even see that in the URL but no matter what I do it doesn't change what's displayed on the page, and the names don't even appear sorted...

    Sorry, don't know what you mean and your pic is not shown. Try using png or jpg or gif ..

  • Sorry, on my computer it shows up. I've changed to PNG. I'm showing the first few users from the users dashboard, properly sorted alphabetically, and the first few users as shown on the member list

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited March 2017

    They are sorted by USER ID it would seem. Si gusta favor de explicar en español. Porque no entiendo cual es el problema.

    Al parecer la lista no es alfabeticamente organizada. Que le dio esta idea ?

    La lista esta organizada por numero de ID de usuario conforme se inscribieron. Si gusta confirmar esto, nada mas tiene que ver el codigo con un web inspector y darse cuenta cual es el numero de los usuarios.

  • sorry, I thought it was alphabetically, not by user ID.

    Sorry also, I don't want to mess up my spanish trying to write it out, I'm brazilian B)

    How would I change the sorting to be alphabetical and not user ID?

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    I inherited this plugin, I did not write it. I would need to figure that out when I have some time.

  • I figured it out. In views/memtable.php just need to change the $UserField to 'Name' instead of 'UserID' on line 15 just as hgtonight had said in a post above. I just wasn't sure what to change it to, but simply enough, it's just 'Name'

    vrijvlinder
Sign In or Register to comment.