#✅ What "fields" can I use in a repeater?
1 messages · Page 1 of 1 (latest)
Thanks for posting! This is a community powered server, so you may or may not get an answer based on available help and expertise. To increase your chances of somebody being able to help you, please help us help you making sure you:
- Adding an explanation of exactly what you're trying to achieve.
- Adding any and all related code or previous attempts.
- Describing the exact issue or error you are facing.
- Posting any screenshots if applicable.
- Reading through https://stackoverflow.com/help/how-to-ask.
When you're done with this thread, please close it. Thanks! ✨
(If you have a support agreement and need help, please contact the core team via email.)
If im not mistaken those are the fields you have added below (under the "edit fields" heading)
Aha! Will try that... Thank you, @near turtle !
Not sure, if I am doing this right. I entered {{ text_category }} in the Template field (with ""XY:" prefixed, just to see what happens) (1st screenshot) and get the interface output shown in the 2nd screenshot, which is a JSON at this point. When I use {{ text_category.collection }} (3rd screenshot) it shows me the name of the table (here: rwfm_textcategory, screenshot 4). I would like to get the title of the current item (the current category in this case, which has a title field) in the collection, so I try {{ text_category.collection.title }}, but that returns nothing. Is there a way to retrieve the title of the current item?
Can I somehow find out how this object is build? (Maybe an API endpoint?)
This is what the text_category item looks like.
I dont think you can unpack JSON data at this point (it's probably just a JSON string for the template)
OK. I was hoping this would be possible, because in the CONTENT section where such a repeater item is created, the title of the collection is shown. But I don't know, why the system knows that it should choose the "title" field (I could have named it something else). Any idea if there is an implementation plan for that? (The screenshot also shows a title field; I implemented this just a minute ago as a work around for the somewhat limited naming option given in the repeater...)
PS: Not to leave any wrong ideas/emotions here: I would like to mention that I think the repeater field is in general really, really awesome! It is almost exactly what I am looking for in a CMS, and Directus delivers it natively!
✅ What "fields" can I use in a repeater?