however we've hit a snag in that the picker now starts at the root level meaning all our paths start with the 'wwwroot' folder:
now we could replace the wwwroot in the /wwwroot/css/site.min.css path but that seems a little clunky...
we've had a dig in the core and found that the rte.prevalues.controller.js uses a stylesheetResource to load in the css style sheets for the rich text editor:
this is kind of an option however has two big issues for us... first, not all sites have the css in a css folder (appreciate this is a requirement for the rte datatype though) and second we also have a file picker for javascript files!
soooo.... is there a way to get the tree picker to start in the wwwroot folder and omit the path?!
I forget where, possibly the Block List configuration, where this exact behavior was driving me up a wall. I wanted to pick a CSS file under wwwroot but then the request for that CSS file resulted in a 404.
This won't directly answer your question but I hope that it gives you at least a temporary reprieve from the frustration.
I added a redirect to my Startup.csConfigure() method.
First: add the appropriate using reference if you haven't already.
using Microsoft.AspNetCore.Rewrite;
Second: add the following code to the Configure() method, preceding app.UseUmbraco()
// Rewrite rules for wwwroot
var options = new RewriteOptions()
.AddRewrite(@"^wwwroot/([\w\W]+)", "$1", skipRemainingRules: true);
app.UseRewriter(options);
You could also do this with a redirect, which is probably more appropriate.
// Rewrite rules for wwwroot
var options = new RewriteOptions()
.AddRedirect("wwwroot/(.*)", "$1");
app.UseRewriter(options);
thank you for the suggestion - my only concern is that this adds the rewrite or redirect for the whole site...
...the problem being the code in question is going to be in an umbraco plugin so once you install it, it'll mess with the target site which might not be the desired behaviour!
there's gotta be a way to do it! i've been trying to figure out how the tree pickers work for things like macros etc where you pick an mcv view and it goes directly to the 'views' folder rather than the tree. there's not much in the way of docos so it's a case of trawling the core looking for a similar example...
is it possible to start the editor service file picker in the wwwroot?
hey out there,
we've been using the editorService.treePicker to allow users to pick a css file in the backoffice:
however we've hit a snag in that the picker now starts at the root level meaning all our paths start with the 'wwwroot' folder:
now we could replace the
wwwroot
in the/wwwroot/css/site.min.css
path but that seems a little clunky...we've had a dig in the core and found that the
rte.prevalues.controller.js
uses astylesheetResource
to load in the css style sheets for the rich text editor:this is kind of an option however has two big issues for us... first, not all sites have the css in a
css
folder (appreciate this is a requirement for the rte datatype though) and second we also have a file picker for javascript files!soooo.... is there a way to get the tree picker to start in the
wwwroot
folder and omit the path?!as ever, any suggestions are greatly received ;)
I forget where, possibly the Block List configuration, where this exact behavior was driving me up a wall. I wanted to pick a CSS file under
wwwroot
but then the request for that CSS file resulted in a 404.This won't directly answer your question but I hope that it gives you at least a temporary reprieve from the frustration.
I added a redirect to my
Startup.cs
Configure()
method.First: add the appropriate using reference if you haven't already.
Second: add the following code to the
Configure()
method, precedingapp.UseUmbraco()
You could also do this with a redirect, which is probably more appropriate.
hi mark,
thank you for the suggestion - my only concern is that this adds the rewrite or redirect for the whole site...
...the problem being the code in question is going to be in an umbraco plugin so once you install it, it'll mess with the target site which might not be the desired behaviour!
there's gotta be a way to do it! i've been trying to figure out how the tree pickers work for things like macros etc where you pick an mcv view and it goes directly to the 'views' folder rather than the tree. there's not much in the way of docos so it's a case of trawling the core looking for a similar example...
either that or it's gonna be roll our own!
the hunt continues,
cheers,
jake
is working on a reply...