Copied to clipboard

Flag this post as spam?

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


  • Elin 45 posts 166 karma points
    Mar 09, 2018 @ 16:26
    Elin
    0

    Add Nested Content to Grid Editor

    Hi,

    I'm trying to add my nested content to the grid editor. I was previously using the LeBlender plugin which worked beautifully but then realized that I would get an error every time I would queue and transfer my content. I'm using Umbraco Cloud and have a dev and live environment.

    I don't want to use any other plugins and would like to get this done manually instead.

    I looked at the below documentations on Grid Editors, and package.manifest, and have a basic idea how I would add a simple editor to the grid, but don't know exactly how to go with adding something complicated as the nested content.

    The part I get most confuse about is the view. Can I add the path to the nested content there, I should I create one?

    Any help in the right direction will be greatly appreciated.

    Thanks.

    Elin

  • David Zweben 265 posts 749 karma points
    Mar 10, 2018 @ 13:13
    David Zweben
    0

    Hi Elin,

    The "View" link is indeed the path to the 'view' of the property editor you want to use. (The view is the "V" in MVC, the architectural pattern on which property editors are built.) This normally links to a path in app_plugins, where custom property editors would be saved. Unfortunately, as part of the core, built-in property editors are compiled into a .dll binary file, so as far as I know, it's not possible to provide a direct path to a built-in property editor's view.

    What you may be able to do, however, is create a custom property editor that simply duplicates the views of the built-in Nested Content property editor, and references the relevant classes in the core DLLs for the controller. Take a look at the source code files here.

    You'll see that the views (the HTML files) just contain HTML and AngularJS, which is pretty simple. The more complex code is in the controllers, which these views link to at the top via the 'ng-controller' property. In theory, you should be able to copy these views to a 'custom' plugin in App_Plugins (following the guide here), but retain the existing references to the Core DLLs at the top, and end up with a 'custom' copy of Nested Content that you'll be able to link to, but that uses the core's controllers. This isn't guaranteed not to break with updates if the views change, but it should be simple to update by re-copying the code from the Umbraco source code.

    Depending on your needs, a possible alternative is to avoid using Nested Content entirely, and to make or install a simpler property editor for repeating content. This way, you could link to it normally without all the trouble of linking up a built-in property editor. If you want to make your own, you could copy the code of the 'Multiple Textstring' property editor as a starting point.

    As a final note, I know you're not looking for a plugin solution, but I wanted to show you this thread, which links to an alternate plugin which may work.

    Hope this helps, and best of luck getting this resolved! If you have any other questions, just let me know.

    Regards,
    David

Please Sign in or register to post replies

Write your reply to:

Draft