I want to render a tree in a dialog box in the backoffice like this it is used to move a content to a 'Shared Content' area of the site (as it is a multi-lingual site):
however I want the tree to only render "Shared Content" not the notes above this. This tree is being rendered by the Umbraco TreeControl usercontrol, and when I set the start node property, nothing changes.
Any Ideas?
Tl;DR: How to render a content tree picker in the backend with a startNode set?
MNTP uses a custom tree control called FilteredContentTree (there's also a Media one if you're interested). Depending which version of Umbraco you are using (e.g. v4.8+) then this is now in the Umbraco core, otherwise for older versions, you can use uComponents (v3.x, v4.x).
The FilteredContentTree control is inside the 'umbraco.editorControls.MultiNodeTreePicker' namespace. From what I recall you will need to use the "umbraco.controls.Tree.CustomTreeControl" to render it.
Keep in mind that I didn't develop MNTP... just a lot of hacking around with it. So feel free to ask any questions, just can't guarantee any answers. ;-)
For DAMP I also set the start node of the media tree and copied that from how it works in MNTP. I don't know exactly what I did, but I remember it did give me a little trouble. Think it's best to look for "StartNode" in the source of MNTP and see in what places it all is used. Also had some javascript involved.
Custom Content Picker
Hey!,
I want to render a tree in a dialog box in the backoffice like this it is used to move a content to a 'Shared Content' area of the site (as it is a multi-lingual site):
however I want the tree to only render "Shared Content" not the notes above this. This tree is being rendered by the Umbraco TreeControl usercontrol, and when I set the start node property, nothing changes.
Any Ideas?
Tl;DR: How to render a content tree picker in the backend with a startNode set?
Thanks!
Have a look at this issue for some improvements: http://issues.umbraco.org/issue/U4-192. Don't think a start node can be used yet. For now I use MNTP for that: http://our.umbraco.org/forum/core/umbraco-5-general-discussion/28363-Umbraco-5-MNTP-features#comment107718
Jeroen
Hi Stephen,
MNTP uses a custom tree control called FilteredContentTree (there's also a Media one if you're interested). Depending which version of Umbraco you are using (e.g. v4.8+) then this is now in the Umbraco core, otherwise for older versions, you can use uComponents (v3.x, v4.x).
The FilteredContentTree control is inside the 'umbraco.editorControls.MultiNodeTreePicker' namespace. From what I recall you will need to use the "umbraco.controls.Tree.CustomTreeControl" to render it.
Keep in mind that I didn't develop MNTP... just a lot of hacking around with it. So feel free to ask any questions, just can't guarantee any answers. ;-)
Cheers, Lee.
Forgot to add... to see how MNTP does this, check the source for the constructor in "umbraco.editorControls.MultiNodeTreePicker.MNTP_DataEditor".
Cheers guys! however I Cannot figure out how to set the StartNodeID
but it isnt obeying the startNodeId >.< it still renders from the Root node :(
Hopefully i'm missing something really stupid and its a simple fix :(
Any ideas?
Love you all..
For DAMP I also set the start node of the media tree and copied that from how it works in MNTP. I don't know exactly what I did, but I remember it did give me a little trouble. Think it's best to look for "StartNode" in the source of MNTP and see in what places it all is used. Also had some javascript involved.
Jeroen
Thanks guys, I got it working with an extension of FilteredContentTree
<3
Sounds like a good package ;-).
Jeroen
@Stephen
I'm currently to to accomplish the same thing and having some trouble. Would you mind sharing your source?
Thanks!
@Dan & everyone, I did write this into a blog post, albeit I forgot to publish the thing.
http://offroadcode.com/blog/2013/3/4/hacking-the-umbraco-content-tree-picker-to-hide-content-to-make-it-easier-for-editors/
is working on a reply...