Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Section/Tree Routing MVC #8438

Closed
Ric-Carey opened this issue Jul 14, 2020 · 3 comments
Closed

Custom Section/Tree Routing MVC #8438

Ric-Carey opened this issue Jul 14, 2020 · 3 comments

Comments

@Ric-Carey
Copy link

Ric-Carey commented Jul 14, 2020

Hello,

So I have followed

https://our.umbraco.com/documentation/extending/section-trees/sections

to create a new section and then

https://our.umbraco.com/documentation/Extending/Section-Trees/trees

to create a new tree within this section. I have then amended the line in "implementing the tree" to:

var node = CreateTreeNode(thing.Key.ToString(), "-1", queryStrings, thing.Value, "icon-presentation", false, "backoffice/customdata/index");

so that it will route custom MVC into the backoffice rather than the default angular HTML.

I have created the backoffice controller using:

https://our.umbraco.com/documentation/Reference/Routing/Authorized/

This works when I am logged in and I navigate to umbraco/backoffice/customdata/index - however, when you click one of the custom tree nodes - the url shown to the user is correct, but when you click it Umbraco redirects to the homepage of the content section.

If i take the custom routepath off the create tree node code - it will return the default app_plugins edit.html screen inside the UI, so i know its not an issue with the custom tree, and because the custom route returns when navigated to i know it isn't an issue with that, I can only assume this is a bug in how Umbraco's JavaScript imports the custom UI in maybe it thinks it doesn’t exist? Am I missing something?

This is using Umbraco 8.6.3.

Let me know if you need more information, please. Ultimately I want to use MVC to route in extra data from a database, without having to create it all in Angular like you used to be able to in earlier versions.

Cheers
Ric

@nul800sebastiaan
Copy link
Member

I'm unsure what you're trying to do as I'm quite unfamiliar with the mentioned extension points. Have you looked at UI-O-matic? They "route in extra data from a database".. 🙂

@nul800sebastiaan nul800sebastiaan added the state/needs-more-info We don't have enough information to give a good reply label Jul 20, 2020
@Ric-Carey
Copy link
Author

Ric-Carey commented Jul 20, 2020

Hey @nul800sebastiaan ,

So in Umb v7 or going further back into 6 – you were able to create a custom section within the Umbraco back office – but you used to be able to route it in as returning custom MVC pages that you had predefined. I think this was possible because it used to use an iframe for the righthand section. (but I may be making that up).

Either way, the current dependency is that if you want to create “additional sections” within the back office that is outside the scope of Umbraco it appears that you need to put it in as Angular HMTL and be dynamic via JavaScript.

I have kind of got around this by using an iframe within an Angular view as a temporary measure and then showing the routed UmbracoAuthorizedController MVC inside it.

It may just be the case is that “it is what it is” now – but from my point of view in this scenario, I just needed to display some data quickly without needing to set it all up to be jazzy with Angular because that hasn’t been scoped as part of the budget and I don’t have the time for that added complication. (RE UIOMATIC - yes I've used it in the past, but this data was a bit more complex than just throwing a poco on the database, it needs to be manipulated before being displayed)

Hope that usecase makes sense? I suppose it goes back to that framework dependency question about the back office that’s floated around for a number of years.

Cheers
Ric

@nul800sebastiaan
Copy link
Member

Alright, I think I understand enough to be able to say: "it is what it is". You might be able to do (hack?) things that I'm not aware of but as far as I know, yes, you'll end up on an AngularJS view (html page) that needs a AngularJS controller for interaction.

We have no plans to change this either at this time, maybe in vNext at some point.

I would suggest you head on out to the forum and ask around there if there's a way to avoid this but I am not aware of anything and the code I can see in the codebase points to this being a requirement.

@umbrabot umbrabot removed the state/needs-more-info We don't have enough information to give a good reply label Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants