Copied to clipboard

Flag this post as spam?

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


  • Jakub Čermák 2 posts 22 karma points
    May 20, 2014 @ 17:32
    Jakub Čermák
    0

    Macro Parameter - limit the Content Picker to children of a single node

    Hello, I've a macro with a single parameter. This parameter is a "link" to a content - I used the Content Type parameter type. Now my customers needs to limit the content tree so that he can see only child content node of some defined content node. Is it possible to do it somehow? I found that I can create my own data types in the Dev section, but they can't be used as a macro parameter. I'm willing to create a C# class to support this feature, but after several hours I count't create a working sample :-(

    Thanks a lot in advance.

  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    May 20, 2014 @ 17:53
    Tim
    0

    Yes, it's possible! You need to create a custom Macro Parameter type class and a custom tree for the picker. I've done it before in v6. I'm not sure if it works the same way in 7 though.

  • Jakub Čermák 2 posts 22 karma points
    May 22, 2014 @ 09:28
    Jakub Čermák
    0

    I was trying to find something like that in the source code, but I failed. Please, do you have some example in Umbraco (a name of the class would be enough) or somewhere else? I found just a lot of outdated articles using obsolete interfaces.

  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    May 22, 2014 @ 10:21
    Tim
    0

    I haven't got the code on the machine I'm working on at the moment, but here's the blog post I used to figure out how to do it: https://offroadcode.com/blog/1543/hacking-the-umbraco-content-tree-picker-to-hide-content-to-make-it-easier-for-editors/

    I'll try and post some example code later on this evening when I'm on my main dev machine.

    My example will probably only work on v6 though. If you're using v7 the code is different, but I haven't had a chance

Please Sign in or register to post replies

Write your reply to:

Draft