Jump to:

1374 Posts in 487 Topics by 520 members

Themes

SilverStripe Forums » Themes » css relative path

Discuss SilverStripe Themes.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 857 Views
  • bebabeba
    Avatar
    Community Member
    192 Posts

    css relative path Link to this post

    Hi!
    in my code/Page.php I use
    Requirements::themedCSS('layout');
    to add css to a page.

    html source code shows <link rel="stylesheet" type="text/css" href="http://www.mysite.com/themes/mytheme/css/layout.css?m=1333695202" />

    silvertstripe replace css name with absolute path.
    I need relative path like this

    <link rel="stylesheet" type="text/css" href="themes/mytheme/css/layout.css?m=1333695202" />

    Is this possible?how?
    thanks!

  • gaethofs
    Avatar
    Community Member
    9 Posts

    Re: css relative path Link to this post

    That's strange. For me it resolves the relative path when using themedCSS.
    Instead of doing this you might want to try something else:

    <% require css(themes/mytheme/css/layout.css) %>

    This should do the same job as

    Requirements::themedCSS('layout');

    Or you can try resolving them manually using $ThemeDir.
    You can find a more detailed explanation over here.

    If this doesn't do the trick I guess it's something in your configuration you'll need to change in order to get the relative urls.

    857 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.