There is a way to make the "Content Reference" field in a Content Fragment Model only accept specific content types, including Page. To do this, you will need to use the "Allowed Content Models" validation option. This option allows you to specify a list of content models that are allowed to be referenced in the property.
To make the field only accept the specific content types you listed, you would add the following content models to the "Allowed Content Models" list:
- ContentFragment
- PlainText
- RichText
- Image
- Audio
- Video
- PDFDocument
- Spreadsheet
- Presentation
- Archive
- Markup
- Page
This will ensure that the content author can only select content from these models when editing the property.
Here are the steps on how to add the "Allowed Content Models" validation option:
- Open the Content Fragment Model in the AEM Content Editor.
- Select the property that you want to restrict.
- In the "Validation" section, click the "Add Validation" button.
- Select "Allowed Content Models" from the list of validation types.
- In the "Allowed Content Models" field, enter the names of the content models that you want to allow, separated by commas.
- Click the "Save" button.
Once you have added the "Allowed Content Models" validation option, the content author will only be able to select content from the specified models when editing the property.
Kautuk Sahni