2
Vote

TypePartEditor for settings should provide access to current content type being edited, (with nice old music)

description

It would be useful to be able to access the list of parts in the content type, see
https://orchard.codeplex.com/discussions/456818

comments

CSADNT wrote Sep 15, 2013 at 9:27 AM

Could be done in
    public EditTypeViewModel GetType(string name) {
        var contentTypeDefinition = _contentDefinitionManager.GetTypeDefinition(name);

        if (contentTypeDefinition == null)
            return null;

        var viewModel = new EditTypeViewModel(contentTypeDefinition) {
            Templates = _contentDefinitionEditorEvents.TypeEditor(contentTypeDefinition)
        };

        foreach (var part in viewModel.Parts) {
            /* replace part.Templates = _contentDefinitionEditorEvents.TypePartEditor(part._Definition); */
            part.Templates = _contentDefinitionEditorEvents.TypePartEditor(contentTypeDefinition ,part._Definition);
            foreach (var field in part.PartDefinition.Fields)
                field.Templates = _contentDefinitionEditorEvents.PartFieldEditor(field._Definition);
        }

        if (viewModel.Fields.Any()) {
            foreach (var field in viewModel.Fields)
                field.Templates = _contentDefinitionEditorEvents.PartFieldEditor(field._Definition);
        }

        return viewModel;
    }

But necessitate many modification in all existing hooks...

sebastienros wrote Feb 4 at 8:06 PM

waiting on pull request change or invalidation of the suggestion

CSADNT wrote Feb 5 at 7:43 PM

CSADNT wrote Feb 18 at 3:38 AM

Any chance to have it checked and apply before next Greek calenda?

CSADNT wrote Mar 4 at 3:25 AM

Will I see this in m'y own lifetime frame...I am a believer...am I?