Relative paths in templates; removing the leading slash.
Hello!
I'm struggling with the following:
I have a template in Umbraco, and in the "src" attribute of one of the img tags, I add an item field, of the type Upload (pointing to an image obviously).
This translates into something like:
<img src="/media/87/logo.gif">
Now, I'm using Umbraco in a subfolder on the server, this works fine, provided I adapt my paths (to my CSS files etc), removing the leading slash. On this item field I'd like to do the same; I'd like the path generated by the upload item field to be "media/..." instead of "/media/...".
I thought of a javascript hack that automatically fixes the urls, but I guess there's a more elegant way to achieve this?
Relative paths in templates; removing the leading slash.
Hello!
I'm struggling with the following:
I have a template in Umbraco, and in the "src" attribute of one of the img tags, I add an item field, of the type Upload (pointing to an image obviously).
This translates into something like:
Now, I'm using Umbraco in a subfolder on the server, this works fine, provided I adapt my paths (to my CSS files etc), removing the leading slash.
On this item field I'd like to do the same; I'd like the path generated by the upload item field to be "media/..." instead of "/media/...".
I thought of a javascript hack that automatically fixes the urls, but I guess there's a more elegant way to achieve this?
Thanks for your time!
Dyte
Slight correction, I don't need to just remove the leading slash, I need my paths all in the following fashion:
"/subfolder-name/css/..."
"/subfolder-name/media/..."
For the hardcodes ones this is easy, but I'm wondering how to do it for the ones that are inserted at runtime, like the upload typed item field.
Nobody?
Basically I'd like to control the format of the paths the Item Fields (e.g. Upload) get translated into.
"/subfoldername/css/..."
instead of the default
"/css/..."
Hi. What version do you use? There used to be a submitted issue with 4.7 that's now reported as closed:
http://umbraco.codeplex.com/workitem/30201
I'm using 4.7.1.
I just bumped on a topic in the old forum, where it's mentioned that it's not possible to install Umbraco in a subfolder of the root website.
Is this still the case?
Because I do manage to run Umbraco in a subfolder, it's just that the paths to the css etc aren't correct.
I guess I should modify a setting somewhere to tell umbraco that he shouldn't load his stuff from
"/CSS/Reset.css"
but from
"/subfolder/CSS/Reset.css"
So right now I'm using a javascript hack along the lines of:
But this is a very ugly way of doing things...
is working on a reply...