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 ContainedStereotypes property to ContentPickerFieldSettings to allow a user to include content-types by steryotype #12066

Closed
MikeAlhayek opened this issue Jul 23, 2022 · 1 comment · Fixed by #12103
Milestone

Comments

@MikeAlhayek
Copy link
Member

Is your feature request related to a problem? Please describe.

When attaching ContentPickerField to a content part, the user must explicitly set DisplayedContentTypes with an array of content-types to be include in the ContentPickerField. This is good for most case, however, it would be great to allow for setting the contained content-types using Stereotype. Stereotype would be in addition to not in place of DisplayedContentTypes.

For example, I want to group all todo items (appointment, meeting) by a stereotype type called ToDoTask. All of these content types share similar functionally which is a todo task. Now I want to use ContentPickerField in a different content type to allow the user to select a todo-task of any kind. In this case, I have to explicitly specific each content types that in the DisplayedContentTypes. But if a new content-type was added later "from other feature/module", the user would have manually to edit the ContentPickerField settings every time/every where todo task are used to add the new content-type which it isn't efficient.

Describe the solution you'd like

Add a way to specific a stereotypes in the ContentPickerFieldSettings in addition to DisplayedContentTypes so the user is able to explicitly able to set displayed-content-types or explicitly set the stereotype.

We can achieve this by changing the ContentPickerFieldSettings to something like this

public class BagPartSettings
{
    public string Hint { get; set; }
    public bool Required { get; set; }
    public bool Multiple { get; set; }
    public bool DisplayAllContentTypes { get; set; } = Array.Empty<string>();
    public string[] DisplayedContentTypes { get; set; } = Array.Empty<string>();
    public string[] DisplayedStereotypes { get; set; } = Array.Empty<string>();
}
@MikeAlhayek
Copy link
Member Author

This request is related to #11977

@MikeAlhayek MikeAlhayek changed the title Add ContainedStereotypes ContentPickerFieldSettings to allow a user to include content-types by steryotype Add ContainedStereotypes property to ContentPickerFieldSettings to allow a user to include content-types by steryotype Jul 26, 2022
MikeAlhayek added a commit to MikeAlhayek/OrchardCore that referenced this issue Jul 27, 2022
…low a user to include content-types by steryotype. Fix OrchardCMS#12066
@sebastienros sebastienros added this to the 1.x milestone Aug 11, 2022
@Skrypt Skrypt modified the milestones: 1.x, 1.5 Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants