Copied to clipboard

Flag this post as spam?

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


  • Christian Bech 20 posts 51 karma points
    Apr 14, 2015 @ 11:32
    Christian Bech
    0

    Custom property editor using custom datatype

    Hi there.

    I'm building a custom property editor that consist of two input boxes and a dropdown box. The input boxes are normal HTML input fields. The dropdown box is a custom Umbraco.Dropdown. My question is how to integrete the custom dropdown box to my custom property editors HTML ?

    Best regards

    Christian

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 14, 2015 @ 11:39
    Jan Skovgaard
    0

    Hi Christian

    I assume that you're using Umbraco 7 and doing things in angularjs? Could you please share the code that you already have?

    /Jan

  • Christian Bech 20 posts 51 karma points
    Apr 14, 2015 @ 11:54
    Christian Bech
    0

    Hi Jan.

    Yup I'm using Umbraco 7 and doing my things in angularjs.

    The HTML file looks something like this:

    <div ng-controller="XXX.Tiles">
    <textarea id="tileOverskrift" ng-model="model.value.tileOverskrift"></textarea><br />
    <textarea id="tileUnderOverskrift" ng-model="model.value.tileUnderOverskrift"></textarea> <br />
    <TileValg id="tileValg" ng-model="model.value.tileValg"></TileValg> <br /> 
    <hr />
    <br />
    

    The only content of the controller is this:

    angular.module("umbraco")
    .controller("XXX.Tiles",
    function ($scope) { });
    

    And the package manifest file:

    {
    propertyEditors: [
        {
            alias: "XXX.Tiles",
            name: "Tiles",
            editor: {
                view: "~/App_Plugins/Tiles/tiles.html"
            }
        }
    ]
    ,
    javascript: [
        '~/App_Plugins/Tiles/tiles.controller.js'
    ]
    

    }

    If I run the app only with the two textareas it works like a charm but I'm not sure how to use an umbraco.dropdown box in the above HTML file.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 22, 2015 @ 18:10
    Jan Skovgaard
    0

    Hi Christian

    Sorry for my late reply - I'm not sure what you mean by "custom umbraco dropdown"? Is it a dropdown that you have created inside umbraco based on the dropdown datatype?

    /Jan

  • Christian Bech 20 posts 51 karma points
    Apr 23, 2015 @ 00:01
    Christian Bech
    0

    Hi Jan.

    Yes it is a dropdown that I have created inside umbraco based on the dropdown datatype. Is it possible to use that dropdown in my custom property editor ?

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Apr 23, 2015 @ 12:32
    Dave Woestenborghs
    1

    Hi Christian,

    In this article I describe how to reuse existing datatypes, like the Umbraco.Dropdown in your own property editors.

    http://24days.in/umbraco/2014/umbraco-angular-tips/

    I think this will help you.

    Dave

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 24, 2015 @ 08:56
    Jan Skovgaard
    0

    How could I forget about that post :) It's really nice Dave! :)

    But I'm wondering...will it also work when one has made a custom instance of say the umbraco.dropdown property editor with some random values in it and saved it with the name "MyCustomDrodown".

    Will it then be possible to simply reference this instance of the property editor?

    /Jan

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Apr 24, 2015 @ 08:59
    Dave Woestenborghs
    1

    Hi Jan,

    That's the idea. You create a datatype in the backend. And then you can retreive that based on the name.

    So you can configure datatypes (for example a nuPickers) to use in your custom components.

    I also show this in the video from my umbraco uk fest talk. It's up on youtube : https://www.youtube.com/watch?v=_sX9eZSn9HI

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 24, 2015 @ 09:03
    Jan Skovgaard
    1

    Hi Dave Awesomesauce - Now the bricks are falling into pieces...that's a saying in english, right? :)

    That's gold Dave - Can't believe it not untill now that I get it - Thanks.

    /Jan

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Apr 24, 2015 @ 09:31
    Dave Woestenborghs
    0

    Hi Jan,

    If you watch the video there are some usefull tips as well regarding to building custom sections in angular.

    Dave

Please Sign in or register to post replies

Write your reply to:

Draft