Copied to clipboard

Flag this post as spam?

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


  • AbsolutelyN 85 posts 433 karma points
    Oct 06, 2020 @ 10:47
    AbsolutelyN
    0

    Backend custom section validation - how?

    I'm building a custom section with lots of custom form fields and multiple navigation tabs. I'm using umb-editor-view as in example below with sub views for the forms all saved with a single umb-button just like the standard umbraco content interface.

    The umbraco backend docs are somewhat lacking in detail which is making developing my first custom section slow work.

    Does anyone know of any good examples or tutorials (or a specific umbraco backend controller) that show how to hook up validation for input boxes, umb-buttons and umb-editor-navigation-item so that I can use the best practices for umbraco backend development rather than rolling my own solution?

    <form name="editBookForm" val-form-manager novalidate>
    
        <umb-editor-view>
    
            <umb-editor-header name="vm.content.name"
                               navigation="vm.content.navigation"
                               name-locked="true"
                               hide-alias="true"
                               hide-description="true"
                               on-select-navigation-item="appChanged(item)"
                               hide-icon="true">
            </umb-editor-header>
    
            <umb-editor-container style="height: 100%;">
                <umb-editor-sub-views sub-views="vm.content.navigation"
                                      model="vm.content">
                </umb-editor-sub-views>
            </umb-editor-container>
    
            <umb-editor-footer>
    
                <umb-editor-footer-content-left>
    
                </umb-editor-footer-content-left>
    
                <umb-editor-footer-content-right>
                    <umb-button 
                                ng-if="vm.showSaveButton"
                                action="vm.clickButton()"
                                type="button"
                                button-style="success"
                                state="vm.buttonState"
                                shortcut="ctrl+c"
                                label="Save changes"
                                disabled="vm.buttonState === 'busy'">
                    </umb-button>
                </umb-editor-footer-content-right>
    
    
            </umb-editor-footer>
    
        </umb-editor-view>
    
    </form>
    
  • Marc Goodson 2141 posts 14344 karma points MVP 8x c-trib
    Oct 06, 2020 @ 19:52
    Marc Goodson
    1

    Hi AbsoutelyN

    Would the source code for the plugin U I O Matic be a good place to start?

    https://github.com/TimGeyssens/UIOMatic/blob/5c7c486f828025c4170883fd47d116f886d889ce/src/UIOMatic/Web/UI/App_Plugins/UIOMatic/backoffice/uiomatic/edit.html

    The plugin generates a form in a custom section in the backoffice automatically for a given database table, to allow editing of that non umbraco content via the backoffice - so it might be implementing the kind of things you are looking at getting working.

    regards

    Marc

  • AbsolutelyN 85 posts 433 karma points
    Oct 06, 2020 @ 22:35
    AbsolutelyN
    0

    Hi Marc

    Thanks for the reply. I remembered uiomatic this afternoon and spent a few hours looking at how it works which was very helpful. Have ideas how to proceed. It would just be nice to have an official best practice pattern to follow though without spending days trying to figure out Umbraco backend source.

    I do wish hq would improve Backend docs, I love Umbraco but this area has always been an issue.

    Thanks!

  • Marc Goodson 2141 posts 14344 karma points MVP 8x c-trib
    Oct 07, 2020 @ 10:00
    Marc Goodson
    0

    We'd be totally up for a PR into the docs following what you work out!

    Perhaps setting up a custom section tutorial?

    I'm sure it would help other people.

    The more specific you can be on the issue tracker over what is missing:

    https://github.com/umbraco/UmbracoDocs/issues

    The more likely resources can be focussed and improve specific things, but if you and other people can share what you've found out, it can drive things much faster and then easier for people to add 'improvements' over time. Most of what is there is contributed by and updated by community members over time.

    regards

    Marc

Please Sign in or register to post replies

Write your reply to:

Draft