Copied to clipboard

Flag this post as spam?

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

  • steschu 86 posts 474 karma points
    Jun 30, 2019 @ 13:38

    built-in property editors: how to inherit and set configuration options


    I know that built-in property editors are located here (\Umbraco\Views\propertyeditors...) and the controllers here (\Umbraco\Js\umbraco.controllers.js).

    Can anybody tell me where the equivalent to the manifest file is for the buil-in editors? I wonder e.g. where the maxChars limit configuration option is declared for the normal textbox property editor? Cannot find any manifest files..

    Further, if I want to add some simple functionality to the existing umraco controller for a property editor, is there a preferred way to inherit somehow? I am not very good at angular yet, but some keywords to google for should help.

    Thanks, Stephan

  • steschu 86 posts 474 karma points
    Jul 01, 2019 @ 08:51

    Anybody any idea?

  • Kevin Jump 2232 posts 14244 karma points MVP 6x c-trib
    Jul 01, 2019 @ 11:56
    Kevin Jump

    Hi Stephan,

    this are some differences between Umbraco 7 and Umbraco 8 so it will depend on which one you are looking at.

    Umbraco 7

    (Tutorial if you haven't seen it

    The Textbox Property Editor is defined in this class :

    You could, in theory, inherit this class and add extra values, but if you are using models builder you would also need to have your own ValueConverter which converts the stored data to and from a string.

    Umbraco 7 Example The StyledTextBox Package has code similar to this ( ) It doesn't override the base values, but does create property editors that can directly replace them with additional values for styles, enforcing limits etc.

    Umbraco 8

    In Umbraco 8 there is a textbox property Editor class

    this defines the configuration (so the class containing the settings)

    and the configuration editor ( which defines how the data type configuration works (in the case of the default editors it shows the parameters defined in the Configuration class).

    you have to override all of these, and add extra implimentation details to the configuration for them to then appear in your datatypes/property editors.

    Umbraco 8 Example - StyledEditors Package has a load of over-rides of the base text/numeric classes to add things like css/style attributes, this does the overriding of the base values so for Umbraco 8 it is the exact way you would need to do it.

  • steschu 86 posts 474 karma points
    Jul 01, 2019 @ 12:33

    Hi Kevin,

    Thanks a lot for your reply. As I understand the textbox config is coded in the umbraco source code, thus not appearing as textstring somewhere in the solution, but compiled in one of the dll files, right?

    Actually my property editors aren't a real package yet. I simply put my html, js, css ... files in the App_Plugin Folder. I will take a look at your styled editors project. Should be an incentive to develop things like you do.

    Cheers, Stephan

Please Sign in or register to post replies

Write your reply to: