Copied to clipboard

Flag this post as spam?

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


  • Jay Dobson 75 posts 121 karma points
    Jan 26, 2016 @ 16:03
    Jay Dobson
    0

    Custom Property Editor isn't displaying in Umbraco v7.3

    Hi All,

    I've been living in Umbraco 4.7 land for quite some time and was tasked with updating my company's site to 7.3. For the most part, the upgrade went well and things are working, but I've noticed that my old .ascx property types are not working.

    I've found some documentation on creating a custom property editor/type to use with my macros but I'm having some issues getting even a basic example to work.

    I've created the directory /App_Plugins/RatesTableDropdown and within this folder I have my package.manifest and a very basic angular example.

    package.manifest:

    {       
    propertyEditors: [      
        {
        alias: "Eq.RatesTableDropdown",
        isParameterEditor: true,
        name: "Rates Table Dropdown",               
        editor: {          
            view: "~/App_Plugins/RatesTableDropdown/ratestabledropdown.html",           
            hideLabel: true,        
            valueType: "TEXT",
            validation: {},
            isReadOnly: false            
        }
    ],
    javascript: [
        '~/App_Plugins/RatesTableDropdown/ratestabledropdown.js'
    ]}
    

    ratestabledropdown.html

    <div ng-controller="Eq.RatesTableDropdown">{{blah}} </div>
    

    ratestabledropdown.js

    angular.module("umbraco")
        .controller("Eq.RatesTableDropdown",
        function () {
            alert("The controller has landed");   
            $scope.blah = "Bloop";
        });
    

    From what I've read, I should be able to save these files, restart the application and in the Developer > Data Types section I should be able to add a new data type, selecting from the drop-down list the new property editor I've added. I'm not seeing this item in the list however.

    I'm sure I've done something incredibly stupid, but I need someone to point out what that is. ;)

    Thanks,

    Jay

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Jan 30, 2016 @ 11:56
    Jan Skovgaard
    0

    Hi Jay

    Umbraco is caching these things pretty hard so you'll need to set the "debug" attribute to "true" in your web.config file if it has not already been done. Otherwise it can be a real struggle to make a property editor.

    You should also make sure to clear the cache when you refresh the browser just to make sure you can see your change each time you hit save in your editor.

    Hope this helps!

    /Jan

  • Jay Dobson 75 posts 121 karma points
    Jan 30, 2016 @ 21:51
    Jay Dobson
    0

    Hey Jan,

    Thanks for the response. Unfortunately, that didn't do the trick. I've taken a break from this issue so I can focus on something other than just spinning my wheels. ;) Umbraco should just automatically pick up the manifest.config right? Or do I need to include this somewhere?

    Thanks,

    Jay

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Jan 31, 2016 @ 09:14
    Jan Skovgaard
    0

    Hi Jay

    A break is sometimes a very good idea - I've been struggling with issues like this myself a few times.

    But everything in the above post with the manifest snippet looks alright to me and yes Umbraco should pick up the manifest. You have placed things correctly - I assume it's placed in the root of your RatesTableDropdown folder, as it should be.

    Apart from setting "debug" to true you might also need to bump the version number in the /config/ClientDependency.config file in order to make sure the backoffice cache has been cleared too.

    And then make sure to clear the browser cache as well. If you're using Google Chrome then the "Clear cache" plugin might be handy to use in circumstances like this https://chrome.google.com/webstore/detail/clear-cache/cppjkneekbjaeellbfkmgnhonkkjfpdn?hl=en

    Now after doing all of this - Are you able to see anything?

    Oooh and by the way...have you tried creating a datatype based on your "RatesTableDropdown" in the developer section? It won't show up in the list of predefined datatypes - You'll need to create a new datatype and then select it from the list of property editors available.

    Then you'll need to make use of that datatype on a document type - Sorry if I'm stating the obvious here but just need to make sure that I have covered every possible angle to make sure we're not missing some steps and focus on something that is actually already correct but seems to be missing because one is not aware that it won't show up by default before there is actually a datatype created based on the property editor :)

    Hope this helps!

    /Jan

  • Jay Dobson 75 posts 121 karma points
    Feb 03, 2016 @ 14:54
    Jay Dobson
    0

    Hey Jan,

    Thanks again for your reply!

    I have tried all of these things. Still no dice. Creating a new data type was where I was looking for the property editor. It just simply won't show.

    The manifest, html and js files are in ~/App_Plugins/RatesTableDropdown

    What mechanism reads the package.manifest file? I noticed in the example I based my property editor from the paths to the view and controller start with ~, which is a server-side c# thing. I'm assuming this manifest file gets processed on the server?

    This is driving me nuts. :)

    Jay

  • Jay Dobson 75 posts 121 karma points
    Feb 03, 2016 @ 15:25
    Jay Dobson
    0

    Just an FYI it was a syntax error on my part in my manifest file.

    I shouldn't be allowed to touch a keyboard. ;)

  • Comment author was deleted

    Feb 03, 2016 @ 15:01

    Anything in the logs? It's probably a small syntax error in the package.manifest

  • Jay Dobson 75 posts 121 karma points
    Feb 03, 2016 @ 15:23
    Jay Dobson
    0

    That was exactly it. I was missing a closing } in the propertyEditors section and I was too dense to check the logs.

    Sometimes the simplest things snag me for way too long. I appreciate the help.

    Thanks Tim!

  • Comment author was deleted

    Feb 03, 2016 @ 15:26

    Great, glad you found the issue :) !

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Feb 03, 2016 @ 15:40
    Jan Skovgaard
    0

    Aaah yes I really should have thought about suggesting that too! So frustrating when that happens - #h5yr Tim :)

    /Jan

Please Sign in or register to post replies

Write your reply to:

Draft