Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add attribute enhancing AllowedTypes on ContentArea/ContentReference usages #30

Open
tomaszmadeyski opened this issue Oct 24, 2023 · 0 comments

Comments

@tomaszmadeyski
Copy link
Contributor

Currently, we can make use of [AllowedTypes] attribute to narrow down the selection of items that can be used in ContentArea or ContentReference fields

[AllowedTypes(AllowedTypes = new[] { typeof(ArticlePageBase) })]
public virtual ContentArea RelatedArticles { get; set; }

[AllowedTypes(AllowedTypes = new[] {typeof(Image)})]
public virtual ContentReference Flag { get; set; }

It would be nice to have a tool that allows us to narrow it down in a smarter way, by introducing custom logic.

For example: I want to be able to allow only items that are located under certain node in the tree

This tool (an attribute?) should behave in the same way as [AllowedTypes] attribute, meaning that:

  • I can't drag&drop items that are not valid
  • I can't choose items from content tree that are not valid
  • I see a description of restrictions in the ContentArea UI control ("You can add these content types")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant