-
☆ A M B ☆
- 326 Posts
I think this will involve a custom TV, but just throwing it out there in case anyone else has an idea (or better yet, an existing solution):
I want to display a list of staff members (set up as MODX users) on an "Our People" page. Currently, I'm using the Peoples snippet to do this. However, I'd like my site managers to be able to determine the sort order of the staff members via a TV on the "Our People" page, ideally with drag-and-drop.
Any suggestions?
I think a regular drop-down list TV would do it with this in the Peoples tag:
Neither of these stick to the wall well but
- user setting used as a menu index like field
- use resources or MIGX instead of just a snippet call
If users don't need their own pages of course prob want to shy away from using resources to represent them.
jpdevries
I confess that I now have no idea what you're trying to do.
If Peoples is displaying the list of users, why would you need a list of users in the TV?
I was assuming that the TV would have something like this to specify the sort field:
username||fullname||email
-
☆ A M B ☆
- 326 Posts
Haha -- sorry to confuse.
The TV is just to make it easier for the site manager to set the sort order of the users as they're displayed on the front end. Peoples is still doing the display; I just want the site manager to be able to control that order via a TV.
I think JP is on the right track with using MIGX -- I'd just add each person as a MIGX item, and then they can just drag-and-drop. It's not quite as clean as a sort TV, but I guess it will get the job done, unless you have another idea.
Right, but in order to set the sort order, why would the site manager need to see a list of users? Couldn't he or she just select the field to sort by?
If you need to sort by an extended field, it shouldn't be too difficult to modify the Peoples snippet to do that with a getCollectionGraph() call instead of getCollection() -- I could be wrong.
-
☆ A M B ☆
- 326 Posts
They need to see the users because I want the sort to be based on an arbitrary arrangement of the users, set by the site manager. For example, let's say I have three users:
1. Aaron Ladage
2. Bob Ray
3. JP DeVries
Those can easily be sorted alphabetically. However, let's say you're the president of the company, JP is vice president, and I'm the janitor (no offense to janitors). I want the site manager to be able to reorder the list like this:
1. Bob Ray
2. JP DeVries
3. Aaron Ladage
That sorting needs to be managed in a single place (I don't want them to have to set an arbitrary sort value on each user). A TV makes the most sense for this, but MIGX is probably as close as I can get without a custom TV input type.
Also, just to clarify: I'm using Peoples right now, but I'm perfectly okay with rolling my own users collection snippet. I just thought there might be a really simple way to do this out of the box that I hadn't thought of.
Ah, I get it now and I see where the drag-and-drop would come in, but I can't think how to implement the UI part of it. For the execution part, you could create a "menuindex" extended field. Maybe you could steal the code used to display resources by menuindex in the tree.