Contentful logo

Contentful Community

Belongs to one relationship

I have 2 content types, lets call them page and pageSection, a page has a reference to multiple sections. Is there a way to enforce a “belongs to one” relationship so that when a section has been added to a page it cant be added to another page? I can’t find any info on this anywhere, but i might be blind.

Hi @joakim.millen,

No, It’s not possible to force a constraint in the other direction. However, when you open an Entry of type ‘Section’ you could click on the Tab ‘References’ on top and verify that the entry is not already linked to a page.

@joakim.millen I wonder about https://www.contentful.com/help/validations/