To override the selection in a relation select dialogue, you need to override the RestrictSelectionOfNewRelatives. The AqlExpressionBuilder parameter is added to the query that fetches the content that is shown in the select dialogue. In the example below, the added expression means that only nodes with a specific template is shown.
public override void RestrictSelectionOfNewRelatives(AqlExpressionBuilder expressionBuilder, MemDefProperty propDef) {
if (propDef.Id == NewsItem.PropertyIdChildren) {
expressionBuilder.And(AqlHierarchicalContent.TemplateId == 999);
}
base.RestrictSelectionOfNewRelatives(expressionBuilder, propDef);
}
You can also replace the whole dialogue with your own custom dialogue, as described in this tutorial:
http://developer.webnodes.com/replacing-the-select-related-content-dialogue