Custom Field - Map
See original GitHub issueHi there 👋
I am trying to have my schema feature an array of contents that can be of different types, as the example below shows:
// Expected json output
{
...
contents: [
{
type: 'lesson-video',
attributes: {
video: 'https://...',
}
},
{
type: 'exercise-free-text',
attributes: {
question: '...'
}
},
{
type: 'exercise-multi-choice',
attributes: {
question: '...',
answers: [ ... ]
}
},
{
type: 'lesson-audio',
attributes: {
audio: 'https://...',
text: '...'
}
},
{
type: 'exercise-multi-choice',
attributes: {
question: '...',
answers: [ ... ]
}
},
{
type: 'recap',
attributes: {
learnings: [ ... ]
}
},
]
...
}
The goal is for my content managers to be able to add contents to the array and have each content featuring dynamic attributes
fields that depend on the content type that has first been selected.
I have tried using Conditional fields from properties and Custom fields but wasn’t able to set this up.
Can someone help with that ? 🙏
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:17 (14 by maintainers)
Top Results From Across the Web
Google Map - ACF
The Google Map field provides an interactive map interface for selecting a location. This field type uses the Google Maps JS API to...
Read more >Customize Salesforce Field Mappings
From Setup, enter the name of the object you want to map the Data.com fields to, for example, Accounts, then select Fields. ·...
Read more >Custom Fields Mapping | Zendesk Developer Docs
Custom Fields Mapping describes how custom fields seen by user (e.g. contact custom field "Role in organisation") are mapped to custom field objects...
Read more >Map Values for Custom Fields in the Mapper
Based on the type of custom field invoked, you can provide the details (internalId and scriptId) of the custom field being mapped and...
Read more >Map Custom Fields Importing in Outlook 2013
I'm trying to import a .csv file into Outlook 2013 Contacts and get as far as the "Map Custom Fields" window. Under the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That would be awesome! There is 2 ways to go:
CustomField
of typearray
. If the types you want to use in your array are preset you can code them inside your component. Otherwise, if you want to make it generic and inject the components externally you can use thefieldProps
like in this example (just a suggestion of how you could implement it)I would suggest to go with the first option, and develop something that works for you. Then you can share it with me and we see how we integrate it 😃
I am also working on creating an example custom field that includes other fields inside, and some internal changes to make a nicer API. I will probably have it ready over the weekend!
Let me know if I can help you with anything else
Hi everyone!
Just to let you know that the
oneOf
prop has been added to Array properties so this feature is now implemented natively in version 0.45.1You can check a sample implementation in: https://github.com/Camberi/firecms/blob/master/example/src/SampleApp/schemas/products_schema.tsx#L62 or the docs: http://firecms.co/docs/api/interfaces/arrayproperty#oneof
I am pretty excited of finally integrating this one! Hope it works for you too