+1-888-365-2779
Try Now
More in this section

Forums / Designing with Sitefinity / absolute path for css

absolute path for css

6 posts, 0 answered
  1. Massimo
    Massimo avatar
    3 posts
    Registered:
    06 Oct 2010
    10 Mar 2011
    Link to this post
    hi,

    is there a way to have sitefinity including the css with an absolute path instead of the relative path?

    so that i'd get on html page something like this:
    <link href="/App..." rel="stylesheet">
    instead of
    <link href="../App..." rel="stylesheet">

    thanks
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    10 Mar 2011
    Link to this post
    Hello Massimo,

    Absolute path means that you should include the host name. It is better to use relative path, because if you move the project on another machine the links to the stylesheets will not be broken. Also I suggest that you should use server controls instead of HTML controls.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. Massimo
    Massimo avatar
    3 posts
    Registered:
    06 Oct 2010
    10 Mar 2011
    Link to this post
    hi Ivan,

    sorry, i didn't mean to include the hostname in the path (like it would be for example href="http://domain.tld/style.css"), but simply with a leading slash (example: href="/style.css").

    i don't understand where sitefinity adds the link stylesheet in the code, since i can't see the line in the master page but i see it in the rendered html. and since i can't find where this happens, i can't change the way the css is linked.

    thank you

  4. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    17 Mar 2011
    Link to this post
    Hello Massimo,

    Is the web site set up as a root web site? If it is as root web site, you should get paths lile /App_data, instead of ../App_data?

    Kind regards,
    Georgi
    the Telerik team
  5. Massimo
    Massimo avatar
    3 posts
    Registered:
    06 Oct 2010
    17 Mar 2011
    Link to this post
    hi Georgi,
    yes, the website is set up in the document root. at least, i see it on domain.tld/ , but i don't know if i can/have to specify somewhere in sitefinity where the website is..

    have to add that the website is multilanguage, so the real home is on domain.tld/en/ and in fact ../ works correctly (i mean, the css is loaded). i'd still like to have the stylesheet included with /App_Themes... instead of ../App_Themes...

    best regards
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    21 Mar 2011
    Link to this post
    Hello Massimo,

    The problem is that you use HTML controls instead of sever controls and in this case you will have problems with the way that the path to your components is resolved.

    Regards,
    Ivan Dimitrov
    the Telerik team
Register for webinar
6 posts, 0 answered