Contentful logo

Contentful Community

Exchanging data between main model and the nested content types

Hello guys,

assuming we have a content that has several nested model-types children, I want a field from a child to be the main (Entry title) for the parent content, is there a way to do this using JS SDK?

Explanation:

  • Main Content (Landing page):
    -content model one
    -content model two:
    -FieldOne (Entry title) —> how can I make this entry title is the main Entry title for the Main Content model?

thanks

Hi @ali.ghali, unfortunately that is not possible. A possibility would be for you to use/create a UI extension that reads the title from a Linked Entry and use it to populate a title field in your current Main content.

Here some UI extension examples: https://github.com/contentful/extensions/tree/master/samples/

HI @Alma,
thank you for your reply,
I think the solution you are suggesting won’t work as well, if I added another UIExtension will have the same issue again, how will force main page title from the newly created UIExtension? still the question,

  • I think you mean maybe creating a UIExtension for the main app which will be really a lot of work to set the title, can you please refer me to the API where I can set the Entry title if there is any?

Thanks a lot
Ali

Hi @ali.ghali, maybe you could have a checkbox boolean value in the linked entry to say if that’s the main title of the parent entry. However I think this is not the perfect way to approach the content modeling.

These two tutorials might help you:

any thing inside UI Extension won’t force the main content page title as we can’t make a Reference link as an Entry title :pensive:

  • thanks for sharing the tutorials will take a look on them.

Best