Copied to clipboard

Flag this post as spam?

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


  • Sylvester 6 posts 87 karma points
    Apr 18, 2016 @ 14:58
    Sylvester
    0

    How do i get current page Level number in Umbraco back office custom property editor?

    Hi,

    I have a custom drop down property to load all my category. In each Umbraco page I am displaying it to select a category for that page. So if i add a page under another one then i should show only its child categories in the drop down.(or if the parent page selects top level category, then child page should select its child categories) for this, I am trying to pass the node id and level id along with my current category Id in order to filter the category names for the next level menus.

    I have tried using $routeParams, editorState.current but both giving other information except the level id. Could some one help me how to get the level id in Umbraco back office custom property editor?

  • Steven Harland 78 posts 495 karma points c-trib
    Apr 18, 2016 @ 15:26
    Steven Harland
    100

    Hi Sylvester,

    There's probably a better way but you could work it out from the path like this:

    var level = editorState.current.path.split(',').length - 1;
    
Please Sign in or register to post replies

Write your reply to:

Draft