Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Peter Jensen 32 posts 137 karma points
    Jun 15, 2021 @ 11:42
    Peter Jensen
    0

    Reusing the umbraco property editors

    I am building a new editor to meet a clients special needs, and for that i need some "overlays" that i get from the editorService

    back in version 7 i was super happy that i could allways reuse a editor from umbraco. and it seems u still can in version 8 but the documentation is just plain wrong or outdated.

    My view is straight forward

    <div ng-controller="Custom.Calculators.AddInput.Controller as vm">
    <ng-form val-form-manager>
        <umb-editor-view>
    
            <umb-editor-header name="model.title"
                               name-locked="true"
                               hide-alias="true"
                               hide-icon="true"
                               hide-description="true">
            </umb-editor-header>
    
            <div ng-switch="vm.mode">
    
                <div ng-switch-when="create">
                    <umb-editor-container>
                        <umb-property property="property" ng-repeat="property in vm.properties">
                            <umb-editor model="property"></umb-editor>
                        </umb-property>
                    </umb-editor-container> 
                </div>
            </div>
    
    
            <umb-editor-footer>
                <umb-editor-footer-content-right>
                    <umb-button type="button"
                                button-style="link"
                                label-key="general_close"
                                shortcut="esc"
                                action="vm.close()">
                    </umb-button>
                    <umb-button type="button"
                                button-style="action"
                                label-key="general_submit"
                                action="vm.submit(model)">
                    </umb-button>
                </umb-editor-footer-content-right>
            </umb-editor-footer>
    
        </umb-editor-view>
    </ng-form></div>
    

    And in my controller i just have an array of props i want to render

    vm.properties = [
        {
            alias: "test",
            label: "asd",
            description: "Alias",
            value: "asd",
            view: "/umbraco/Views/propertyeditors/textbox/textbox.html"
        },
        {
            alias: "sadasd",
            label: "LAbel",
            description: "This is my property.",
            value: "sad",
            view: "/umbraco/Views/propertyeditors/textbox/textbox.html" //working but styling is off
        },
        {
            alias: "asdasddd",
            label: "LAbel",
            description: "This is my property.",
            value: "sad",
            view: "contentpicker"
        },
        {
            alias: "test",
            label: "Test",
            description: "This is my property.",
            value: "sad",
            view: "textbox" // not working trows 404 
        }
    ];
    

    My problem is that i have to use abesolut paths to the views. ells i get a 404 error but if i use abeslute paths it renders very very wrong there is a textbox but it looks like crap

    WHAt am i missing ??

  • atup uxi 2 posts 71 karma points
    Jun 16, 2021 @ 09:22
Please Sign in or register to post replies

Write your reply to:

Draft