Copied to clipboard

Flag this post as spam?

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


  • Nez 8 posts 38 karma points
    Mar 17, 2023 @ 20:56
    Nez
    0

    Custom Property Editor: How to add more field dynamically (like listtextstring)?

    Hello,

    I need help making my editor to be able to dynamically add more fields just like listtextstring or multiurlpicker.

    A link to some sort of a guide would be very helpful. I just couldnt find any documentation about it at all.

    What I aim to do is having 2 type of field for url. One is for iframe link and the other one will be for github repo.

    That way user can add multiple url link and github repo link in one element.

    enter image description here

    This is currently what I have right now. for package.manifest

       {
        "propertyEditors": [
            {
                "name": "DoubleTextBox",
                "alias": "DoubleTextBox",
                "editor": {
                    "view": "~/App_Plugins/DoubleTextBox/DoubleTextBoxView.html",
                    "valueType": "JSON"
                }
            }
        ],
        "javascript": [
            "~/App_Plugins/DoubleTextBox/DoubleTextBoxController.js"
        ]
    }
    

    my html

    <div ng-controller="DoubleTextBoxController" class="guiInputStandardSize">
        <input id="testone" type="text" ng-model="model.value.left"/>
        <input id="testtwo" type="text" ng-model="model.value.right" />
    </div>
    

    my js

    angular.module("umbraco").controller("MyDataTypeController", function ($scope) { });
    
  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Mar 19, 2023 @ 20:23
    Chriztian Steinmeier
    100

    Hi Nez,

    I know it's not exactly what you want, but I made a Key/Value editor a while ago, mostly based on the built-in Repeatable TextString editor - feel free to take a look at how it works:

    https://github.com/vokseverk/Vokseverk.KeyValueEditor#keyvalue-editor-for-umbraco

    Hope this helps, /Chriztian

  • Nez 8 posts 38 karma points
    Mar 20, 2023 @ 21:38
    Nez
    0

    oh wow thank you! This help me a lot on how to create my own editor :D

Please Sign in or register to post replies

Write your reply to:

Draft