EPiServer has a builtin Content References list property which is used to collect list of pages, blocks, or media. To add new reference, editor could D&D content or click Browse. Clicking Browse button will show dialog with content tree.

ContentReferences browse page

By default tree root is set to system Root page. In some scenarios it could be better to show only pages related with the content type. For example in multisite solution we would like to show tree related with the single site. I tried to prepare solution for this.

The change is very simple. We just need to declare new attribute that implements IMetadataAware interface. In OnMetadataCreated method we need to assign roots property for EditorConfiguration settings. The roots will be configured in the AppSettings section of web.config file. The key to the settings will be passed as the attribute constructor parameter.

Below is the sample web.conig configuration:

To use new feature we need to add CustomContentReferencesRoot on the model property.

And here are dialog windows showed for those two properties:

ContentReferences List for Site 1

ContentReferences List for Site 2