stylesheets in "CSS" folder not being loaded - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

stylesheets in "CSS" folder not being loaded

  • stylesheets in "CSS" folder not being loaded
  • Hello,

    I apologize if this has been covered, but I wasn't able to find it mentioned anywhere.

    Whenever I link to a stylesheets within the CSS folder of my theme, the file is not found.

    I have a theme installed/added and recognized under "Frontend themes" in the "Administration" menu.  The CSSLoadOrder is correctly displaying all of the stylesheets within the Global folder.  Also, all images under the Images directory display correctly when referenced.  My problem is just referencing the files within the CSS folder.

    I'm using the CSS widget (under the "Scripts and Styles" category) to reference the CSS folder stylesheets.  I've tried adding the file through the CSS widget on a template and on a page and neither work.

    Also, in case it's related, I've run into the same problem trying to add javascript files from the JS folder under "WebsiteTemplates > [Template]" using the Java Script widget.  They don't load.

  • 5dcd9c23-8874-422e-8b1b-4c411f30014f_Styles.PNG
    Hello Scott,

    Actually, as long as you have your styles in the Global folder of the theme, as in the attached image, you don't need to reference them again with a css widget. they will be loaded authomatically. If you need to load external css files (which will not be part of the theme) you can use the widget, but I will recommend you to place those styles in a folder with a different name and outside the theme, because you may experience some permissions problems. 

    Kind regards,
    Jen Peleva
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  • Thank you Jen.  The stylesheets I'm trying to load are not meant to be part of a theme, so I'll try to add a different "Styles" folder on the same level as "Global".

    I was confused because the folder structure that Sitefinity suggests puts a folder called "CSS" on the same level as "Global" and that's what I'm trying to use.  I'll see if renaming it helps at all.

    Thanks again.

    - Scott

  • I solved my problem.  The issue was that the Sitefinity widget was not entering the right path.  This could be just our installation and configuration.

    When I selected a CSS file, the path would be something like "".

    Sitefinity wouldn't find that file.  So I removed everything from the beginning of the URL through App_Data, leaving "/Sitefinity/...".  This works.

    I'm not sure why Sitefinity is applying incorrect URLs.  Again, it may be our installation, but we setup our structure to match Sitefinity's suggestion:

    I'll look into configuration settings on this on my own, but can anyone point me to a spot where this path adjustment could be made globally?


  • Hey Scott,

    The structure you refer to is correct, and for themes it is the correct folder path to input (

    A CSS Widget however is just like a regular link tag, as in it has no access to the /App_Data folder.
    To accomodate for that, Sitefinity basically 'rewrites' the path and removes the /App_Data part of the url.

    So both and /Sitefinity/... would work, it's just a .NET restriction that you can't reference the App_Data folder.

  • Jochem, thank you for the explanation.  It makes total sense.  The puzzling thing about the CSS Widget is that it didn't remove the "App_Data" part of the URL.  I had to do it manually.  That's my concern.  Is there some tweak that I have to make to my installation of Sitefinity to get the CSS (and possible Javascript) widgets to work correctly and remove the "App_Data" part of URLs?  Is there a setting I can check to make sure it's not on our end?  Is it somehow a bug?

    Thanks for the feedback.  This is very helpful.

  • Hey Scott,

    No as far as I know its not something on your end.

    When you select a page by the browse button, it simply translates that folder/file into a url by pasting the domain in front of it and not checking if it is a valid url. To be honest you should try and avoid using those full urls and change them to partials if you can.

    By default you end up with something like this:

    But usually that localhost is a development server or later on you might move the project from a root to an application, then all of a sudden all those hardcoded links break because localhost/.../.... is no longer working but it should be or development/.../Sitefinity

    Best practice is to remove everything from the url-part left of /Sitefinity, so you end up with 

    That squiggly will then automatically be resolved by .NET to wherever your site is installed, on whatever domain and whatever subfolder you've installed as 'root'.