-
Notifications
You must be signed in to change notification settings - Fork 41
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
Default Redirect Configuration #151
Comments
Hi @cornehoskam Not currently 😦 I guess adding support for that could make sense, but that would require sending a model to the add redirect overlay, which isn't happening right now. |
Hi Anders, Darn, that's a shame! Thank you anyway for the quick response! 🙂 |
Thinking a bit more about it, broadcasting a JavaScript event that lets you manipulate the initial model might actually not require that much. I can try giving that a go. Doing the same from C# would require some more development. Is this for Umbraco 10 btw? |
As of right now it's still the latest version of Umbraco 9, but we're also in the middle of upgrading and within a week we should be on Umbraco 10, so consider this question only relevant for v10! 🙂 |
This commit introduces two new events broadcasted via Umbraco's JavaScript event system. The events could be used for setting default values for new redirects, or manipulating the parts of the UI of the redirect overlay. Related to #151
Hi @cornehoskam I just pushed a new app.run(function (eventsService) {
eventsService.on("skybrud.umbraco.redirects.overlay.initializing", function (_, args) {
if (args.model.redirect.id > 0) return;
args.model.redirect.forward = true;
args.model.redirect.permanent = false;
});
eventsService.on("skybrud.umbraco.redirects.overlay.initialized", function (_, args) {
if (args.model.redirect.id === 0) return;
args.model.navigation.push({
alias: "statistics",
name: "Statistics",
view: "nope",
icon: "icon-chart-curve"
});
});
}); The overlay does various initialization - eg. it creates an array of the properties visible in the overlay. To change the default value for Forward query string, you'd want to use the The events also allows you to do other things - eg. add a fictitious content app showing statistics about the redirect via the The release is for Umbraco 10. I can't remember how much it will take to change the same in the Umbraco 9 package. |
What's the appetite for having this configured in C#? Not sure how much work is involved (I'd be happy to spend some time on it). Having something set in the appsettings would feel much more natural than requiring to create a "package" to inject some JS for this. |
It's not something I've looked for in a while - partially because it has only been requested a few times. But it's a feature that does make sense to improve a bit. The current JS solution was quick to add, but I agree that is should be configurable from app settings and potentially also C#. @Rockerby if you're working on something, I'd suggest introducing a I'm not entirely sure about the Redirects can be added both from the dashboard, the content app and the inbound redirects property editor. The default setting models somehow needs to be passed on to the Angular controllers for these. It could be via the exiting API calls to get redirects in a given context. Or since the package is already setting some server variables, these could be extended to expose the default settings: I hope this helps. Otherwise it's totally fine to submit an unfinished PR, and I can try to help out and point you in the right direction 😉 |
Hi there!
Is there an option to set a Default configuration when adding a new redirect? Our client wishes for the "Forward query string" option to be enabled by default when adding new redirects, and only explicitly disable it when they wish to do so, to make sure that they don't forget to enable this option. Is there any option/configuration to do this?
Kind regards,
The text was updated successfully, but these errors were encountered: