statamic / ideas

💡Discussions on ideas and feature requests for Statamic
https://statamic.dev
30 stars 1 forks source link

Entries fieldtype: More granular filtering of collections #989

Open univers-andrew opened 1 year ago

univers-andrew commented 1 year ago

Currently building a FAQs collection on a site... and encountered a situation where it would be useful to filter the entries fieldtype more granulurly then just the collection for ideal editor user experience. Considering the following example:

Each individual FAQ is connect to at least one 'Service' entry managed in the 'Services' collection.

With the the collection, I've created saved filters using this service field. See the two screenshots below:

Screenshot 2023-05-12 at 10 19 15 am Screenshot 2023-05-12 at 10 19 26 am

Back in the individual entries for each Service, my thought was to use an entries fieldtype to allow editors to feature/curate a few key FAQs shown on the individual services page by selecting entries from the FAQ collection, filtered by the relevant service (depending on the service). Currently there's no way out of the box to filter further than the collection (all entries in the collection are shown), but it would be really nice if that was possible!

Screenshot 2023-05-12 at 10 28 22 am Screenshot 2023-05-12 at 10 19 46 am Screenshot 2023-05-12 at 10 20 12 am

Given this approach was a no go, my next thought was testing if we could approach this by just directing editors to manage the order of each FAQ entries within the collection. Unforutnately this doesn't work especially well — I encountered a few issues:

  1. If I try to reorder entries within the FAQ collection with a saved filter engaged, it disables the filter — not the end of the world, but it's not a great user experience for this use case
  2. If I select reorder, then engage a filter on the collection and try to reorder the results can't be saved (an error is thrown).

Unfortunately, it seems like my idea to manage all the site FAQS in a single collection isn't really viable with Statamic currently. I know I could create multiple FAQ collections for each service, but it's a pretty ugly CP experience compared to having a single collection. Hopefully this issue can advocate for more advanced entries/filtering relationships, and how this can create a more impressive CP experience for editors if used with intention!

Happy to chat further, if anyone is interested in delving more into the through more, or this doesn't make any sense lol. If any Statamic experts have a better idea of how I could approach this cp idea I'm all ears too!

Screenshot 2023-05-12 at 10 50 58 am
marcinkudelski-berry commented 7 months ago

I have the same problem with reordering entries in my collection when filter view other than "All" is enabled.

It makes bad user experience managing large number of documents (in my case this is "Documents" collection, which is connected to taxonomies: documents_category and documents_status).

When I add new one, it has to go to specific order of the list in categories in which they are added, so I have to enable pagination to 500, then reorder, but with all above 200 entries in different categories and statuses, so it is very unconvenient.

So I did similar to above, created different filter views, but when I click "reorder", then apply filter, and then reorder, I have same error "Something went wrong". This "going back to All" thing is also not very good, because when user is in filter mode (filtering to desired category/status), and then clicks "Reorder" it switches automatically to "All", then I have to click on filter once again - so 2 reloads are happening. This is also bad user experience.

So question is: Why filters are allowed when reordering, when functionality doesn't work? It should work in my opinion, disabling filters in reorder is not a solution :)

I found That error is caused because "site" variable value is "null" when filter is activated (and this is checked in Statamic Reorder Controller), when I reorder in "All" view, then: site:"default", and it is working.

Is there any chance to solve it?