Adding filter in options, not an issue but a note

#1 ยท open ยท 1 comments

View on GitHub โ†—

stefanKBL

My configuration: - usage of a named Variables collection (with multilinguage suport) with 2 fields (parent and title) - parent is used to reference a sort of families or categories instead of create multiple collections (create for example parents type_content and colors) - parent can have multiple entries Then in another collection, call it Posts, i use the selectRequestOptions field, but need to filter options, as some Variables entries are not in the Posts context (display type_content but not colors) So in the posts collection, the field Options is now, with a "new" filter object ``` { "request": "/collections/find", "key": "entries", "options": { "collection": "variables", "options": { "fields": { "title": "true", "_id": "true" }, "filter": { "parent": "type_content" } } }, "label": "title", "value": "_id" } ``` And when displaying a Posts entry, only type_content are selectable, no colors. Great ๐Ÿ˜„ SelectRequestOptions is a must to have module for cockpit Thanks

Comments

raffaelj

Thanks for pointing that out. You can use all available options that your request can receive, like lang or limit etc. When I have time, I'll write some more examples with screenshots and move the long example list from the readme into a docs folder... > SelectRequestOptions is a must to have module for cockpit Thanks :slightly_smiling_face: