Hey, new to Cockpit and attempting to create a simple collection that outputs its response via JSON. I’ve managed to get the collection outputting however, it’s including all the extra fields that are not needed. How can I simplify the output to only contain the data that’s needed? In the example below I’d only need the name and ID, not the rest - Thanks
Also, to clarify I don’t need front end logic
"name": "Test 1",
I feel like this is a bit hacky, you can filter fields via URL like
There are two more methods to achieve it.
If you only want to grab a few fields, you can use
graphql addon of Cockpit called CockpitQL
You can modify the entry fields with this below method.
My bad, I should have mentioned that populate only work with collectionLink.
And you can’t retrieve accountLink data with collection data at the same time. Maybe it could be the security reason.
Fire one more API request with account ID to get the user data
Ref answer by raffaelj: How to refer to another Collections or "Accounts" - #7 by raffaelj
create config directory in the root folder, under that directory create bootstrap.php file. Add the below codes. Make sure yo…