How to set a filter to a fixed property value? #131
-
The API endpoint The BooleanFilter looks good at first, but we can't have the attribute controllable from outside ( Is there a way to hardcode a default value to the filter-property? Currently it seems we must create a custom |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
There is nothing build in in t3api so far. In below example only records that have The same enable field can be reused in several TCA definitions if done well like below. In TCA:
then in
finally
|
Beta Was this translation helpful? Give feedback.
-
Interesting concept, but I'm not sure if this is practicable e.g. if we have records like "news" with a flag News records with I think the distinction here is output on website vs. API. Do you see a solution for this even with enable-columns? |
Beta Was this translation helpful? Give feedback.
-
I suppose to accomplish your reqs is enough that inside enableColumn function we have info that we are in t3api request? |
Beta Was this translation helpful? Give feedback.
There is nothing build in in t3api so far.
We do such things with enableColumns.
In below example only records that have
public
set to 1 are returned. There is additional condition that will return not public if those records belongs to current FE user. Good if you need to show current user his all records no matter they are public or not.The same enable field can be reused in several TCA definitions if done well like below.
In TCA: