Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sorting, please? #3

Open
lljohnston opened this issue Feb 28, 2022 · 6 comments
Open

Sorting, please? #3

lljohnston opened this issue Feb 28, 2022 · 6 comments

Comments

@lljohnston
Copy link

This is great! The instance I manage adds content to collection on a regular basis and having dynamic content makes life much easier. Is it possible to add a sort feature, based on the contents of a single field? It would have to be able to pull from any item type, because what I'd love to do is sort based on a field from a custom item type we have that has custom fields.

@jaguillette
Copy link
Owner

I'm glad that the plugin is helpful to you! Implementing that kind of sorting will be a bit difficult, since it's not something that's built in to the method that I'm using to gather the items and collections where it'd be relevant. I don't have much time to devote to new feature development now, but if this would be helpful to others please say so! The more people that would benefit the easier it is to devote time to new development.

@lljohnston
Copy link
Author

I would think it would be, such as being able to sort by Date or Creator or Location. My use case is that I need to sort by a numeric value in an element in my custom item type for the order in which items were shown at events.

@margalini
Copy link

I also like being able to group exhibits. But it does not order the different groups by the same criteria and I would like to be able to order them by date.

@lljohnston
Copy link
Author

lljohnston commented Jun 4, 2024

Coming back to say that this is still something I would find really useful. I'd love to be able to sort within an item block by Title or Date or Creator, as well as an arbitrary field.

Maybe a way to integrate item shortcodes?

@jaguillette
Copy link
Owner

It's unlikely that I'll be able to devote time to adding features to this plugin in the foreseeable future. Anyone is welcome to fork this repository to add features or submit a pull request to enable this functionality though.

@zerocrates
Copy link

Just a comment for anyone looking to implement this... I may be misinterpreting some of the prior messages here, but I did want to point out that get_records, the function used here to get the items, etc. to display, does support sorting. You pass it the keys sort_field and sort_dir along with the other keys used to filter the returned records.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants