Jumoo / uSync.Complete.Issues

Public Issue tracker and roadmap for uSync.Complete
https://jumoo.co.uk/usync/complete/
2 stars 1 forks source link

Ability to move the uSync trees from publisher #83

Closed KevinJump closed 3 years ago

KevinJump commented 3 years ago

It is a non-trivial task in Umbraco 8 to move trees between sections https://our.umbraco.com/forum/using-umbraco-and-getting-started/101087-moving-trees-to-another-section

you can't remove a tree, but through code you can hide it from the user: https://our.umbraco.com/forum/using-umbraco-and-getting-started/103167-removing-a-tree-node-from-the-settings-section-in-the-backoffice#comment-322416

then using a custom tree that inherited the base tree you could move the tree to a new section

    [UmbracoTreeAuthorize(Publisher.Trees.Name)]
    [Tree(Constants.Applications.Media, Publisher.Trees.Name,
    TreeGroup = Publisher.Trees.Group, TreeTitle = "uSync Publisher", SortOrder = Publisher.Trees.Order)]
    public class MediaPublishTreeController : PublisherTreeController
    {
        public MediaPublishTreeController(uSyncPublisherConfig config) : base(config)
        {
        }
    }

however there are few placed within the controller that expect to be in the settings section, these can be changed to use the classes current sectionName. and then things work.

e.g

root.RoutePath = $"{Constants.Applications.Settings}/{Publisher.Trees.Name}/dashboard";

needs to become :

root.RoutePath = $"{this.SectionAlias}/{Publisher.Trees.Name}/dashboard";

once these changes are done then code will be able to "move" the trees (bit hacky)