Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Warren Harding 132 posts 275 karma points
    Jun 09, 2016 @ 00:00
    Warren Harding
    0

    Stylesheet Location

    Is there a way to alter the location of the Stylesheets so that say /Content/Styles is displayed underneath Settings > Stylesheets rather than /css ?

    Cheers.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jun 09, 2016 @ 08:19
    Jan Skovgaard
    2

    Hi Warren

    I'm curious about why you want to change this? If you really really need to then you can try what I suggest below. But can you ellaborate a bit more about why you want to do this? If it's for handling the styles for you entire site then you should not create and manage the stylesheet from within Umbraco in my humble opinion :) Then you can place the stylesheet wherever you want and then reference it in your master/layout file.

    In older versions it was possible to change the location path for the stylesheets created from within Umbraco by adding a key to the appSettings section in the web.config.

    You can read about it in the legacy documentation here https://our.umbraco.org/wiki/reference/webconfig/additional-umbraco-specific-appsettings/

    Since the legacy documentation is only available for reference purposes I has not gotten that much TLC lately it seems so the specific part about the paths can be hard to find so I quote from this page

    umbracoCssDirectory - by adding this to appSettings you can specify a new/different folder for storing your css-files and still be able to edit them within Umbraco. Default folder is ~/css.

    Now since this used to work in older versions it's no guarantee that this is still supported in Umbraco 7 - I have not tried it myself.

    But you can try to add the app key like this

    <appSettings>
         <add key="umbracoCssDirectory" value="your\path\to\the\css" />
    </appSettings>
    

    Looking forward to hearing from you,

    /Jan

  • David Dunhill 4 posts 25 karma points
    Jun 09, 2016 @ 10:38
    David Dunhill
    0

    Hi

    just tried this on 7.4.2 assembly: 1.0.5921.28477. and it works fine.

    The reason we needed to do this was our folder structure is different due to the front end work being done by front end devs on templates and sass. the css files being ported across from their dev environment when they commit.

    Cheers

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jun 09, 2016 @ 10:44
    Jan Skovgaard
    0

    Hi David

    Happy to hear that it works - Puzzled about the workflow though described though, but as long as it works and makes sense for you guys then all is good :)

    Happy developing!

    /Jan

  • Warren Harding 132 posts 275 karma points
    Jun 09, 2016 @ 22:35
    Warren Harding
    0

    Thanks guys - similar story for us as well, but primarily the reason for us is so we can transport the Css files with Courier easily.

    Having a look at the 7.4 source code, it appears that umbracoScriptsPath is a similar key we could define for the scripts too?

  • Warren Harding 132 posts 275 karma points
    Jun 10, 2016 @ 00:27
    Warren Harding
    0

    Confirmed. That works as well.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jun 10, 2016 @ 05:09
    Jan Skovgaard
    0

    Hi Warren

    Yes that can be done too - Think it's also mentioned in the documentation referenced above.

    /Jan

  • Jeroen Oostwouder 104 posts 300 karma points
    Aug 27, 2018 @ 08:42
    Jeroen Oostwouder
    0

    Just a quick kick to this post.

    I also needed this functionality and I can confirm it works in 7.12.1 too :)

    The reason I need it, is the folder-structure.

    For our front-end styles (style-files that are uploaded to the server) we use the folder "/Lib/Css". It includes for example all compiled less files and such.

    But we need our clients to be able to select some "formats" in the RTE. The only way I know how, is to create a CSS file within Umbraco. We don't use that file on the front-end. It's only used to fill the "format" list from the RTE and to show within the RTE. Just so a client can create headers or highlighted texts.

    If we keep it default, we would end up with 2 CSS folders (/Css for Umbraco, and /Lib/Css for 'our' files). We don't want that.

    So this solution keeps all the (live needed) Css-files nicely in one place.

Please Sign in or register to post replies

Write your reply to:

Draft