Copied to clipboard

Flag this post as spam?

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


  • John Mc 9 posts 81 karma points
    Apr 20, 2016 @ 13:13
    John Mc
    0

    Reusing the Content Editors in Custom Tree

    Hi,

    I'm new to the Umbraco world, and have failed to find any documentation on what I want to do.

    I've created a new Section and related Tree Controller. The Tree Controller is basically showing content the User is allowed to modify. What I'd like to do, is when one of the tree nodes is selected, to show the standard Content Editing view in the frame on the right.

    How do I do this?

    Many thanks, John

  • David Brendel 792 posts 2970 karma points MVP 3x c-trib
    Apr 20, 2016 @ 14:41
    David Brendel
    1

    Hi John,

    as far AS I know you can't use the same view for your custom nodes. You have to create the view yourself with the editors you need.

    But you can reuse the property editors that are available in umbraco like textbox, datepicker and so on.

    Regards David

  • Nicholas Westby 2054 posts 7103 karma points c-trib
    Apr 20, 2016 @ 15:25
    Nicholas Westby
    0

    Merchello is doing exactly that, I believe. Take a look at their source to see how they do it: https://github.com/Merchello/Merchello

  • Nicholas Westby 2054 posts 7103 karma points c-trib
    Apr 20, 2016 @ 16:38
    Nicholas Westby
    0

    Also, here's an example of how to recreate the editing experience from the content section in your own section: https://github.com/rhythmagency/formulate/blob/b4145be9c54b8b8dad0e73de59d10ec6633e6dd5/src/formulate.app/Directives/validationDesigner/designer.html

    That's the markup for the validation designer in Formulate. It looks like this:

    Validation Designer

    While most of it is not relevant to you, there is some JavaScript that accompanies that designer that may be illuminating: https://github.com/rhythmagency/formulate/blob/b4145be9c54b8b8dad0e73de59d10ec6633e6dd5/src/formulate.app/Directives/validationDesigner/designer.js

    And there's another HTML file that makes use of the above Angular directive: https://github.com/rhythmagency/formulate/blob/b4145be9c54b8b8dad0e73de59d10ec6633e6dd5/src/formulate.app/App_Plugins/formulate/backoffice/formulate/editValidation.html

    You'll also have to add a bit of C# code to manage you tree to ensure that your designer shows up when you click on a content node. I can point that out to you too if you need a bit of help in that area as well.

  • John Mc 9 posts 81 karma points
    Apr 21, 2016 @ 08:46
    John Mc
    0

    Thanks, I'll have a look a that and let you know how I get on :)

  • John Mc 9 posts 81 karma points
    Apr 21, 2016 @ 14:46
    John Mc
    0

    So I had a look a the Merchello stuff, if I was looking at the right place, i t looks like they've essentially rewritten the Content Views, controllers, etc. Is that right? Or was I looking at the wrong bit?

  • Nicholas Westby 2054 posts 7103 karma points c-trib
    Apr 21, 2016 @ 15:25
    Nicholas Westby
    0

    I suspect what Merchello has done is write the high level stuff themselves (e.g., the dashboards/content views and Angular controllers for those dashboards), but I think they are most likely dynamically creating the built-in Umbraco property editors.

    That is, I believe they are not recreating the property editor directives and the associated Angular controllers for those property editor directives.

    I could be wrong, but from the little I know that is my strong suspicion.

    Also, keep in mind that when I say "rewrite the dashboards", Umbraco has a number of directives to help make creating those dashboards easier. For example, there are a couple of directives that help create the tabs at the top of the dashboards and there is a directive for the editable name above the tabs.

    And from what I hear, they have very recently updated the code comments so that the purpose of and usage instructions for each of the directives is much clearer. Might be worth taking a peak at the Umbraco core source code for that.

  • Dave Woestenborghs 3504 posts 12134 karma points MVP 9x admin c-trib
    Apr 21, 2016 @ 15:21
    Dave Woestenborghs
    0

    Hi John,

    I gave a presentation on creating custom sections with Angular at the 2014 Umbraco UK Festival.

    The code and the video of that presentation are still online : https://bitbucket.org/dawoe/umbukfestival2014/

    https://www.youtube.com/watch?v=_sX9eZSn9HI

    I think most of the things I show in there are still acurate and can be a good starting point.

    Dave

  • John Mc 9 posts 81 karma points
    Apr 26, 2016 @ 14:48
    John Mc
    0

    So I've decided against trying to replicate the Content Editors. Instead, I've created a new section that allows an administrator to set what a person can edit/view, but in the context of the domain.

    The view backs on to a WebApi that know what permissions to set given a domain context.

    The user is then restricted as to what they can see in the normal Content Tree.

Please Sign in or register to post replies

Write your reply to:

Draft