Hi ,
I have prepared some collections that act as modules displayed in the mobile application. For example, an “authors module” where there can be several authors (minimum 1, but no more than 10), each with a photo, first name, last name and isActive half.
Nowhere in Directus did I find the functionality I would like to achieve - is it possible to disable the entire collection with, for example, a single checkbox (this would be tantamount to no widget in the mobile app)? In addition, I would like to ask if it is possible to add validation on the number of active authors (for example, so that it is not possible to exceed the range of 1-10 with the display of the dialog)?
I would appreciate any help and suggestions!
Hi there and welcome to the community
I’m not sure I totally understand the question here or what you’re trying to achieve.
Could you provide a bit more context about:
- What specific collections you’re working with
- What you mean by “turn off” - are you looking to hide them, disable them, or something else?
- What your end goal is
The more details you can share, the better I can help point you in the right direction!
Hello!
The example collection is authors (screenshot below), however, the target will be different structures (the goal is to manage widgets in the mobile app from Directus). There is still an API between the mobile app and Directus (I will be querying the Directus API from it).
I wanted such functionality:
Technically:
The mobile app queries the API for data from the “Authors” module, the API queries Directus (if there is no such information in the cache) to find out if the collection is enabled and if it is, it returns all records that are active (isActive field).
Business-wise:
As a CMS administrator, I have an easy way to disable the entire collection (without having to disable each author individually). This will disable the widget in the mobile app that displays author data.
At the moment I have achieved something similar by nesting the collection (screenshot in the next post), but I don’t know if this is the optimal approach.
As for validating the number of active authors, I have already achieved this through Flows.
I hope that now my goal is clear
In addition, another question came up while I was working - if I store files on AWS S3, is it possible to return a link directly to S3 when querying for author/collection data?
So you want to turn off this collection for ALL users of the application? Or just for certain users?