Jump to:

23377 Posts in 18296 Topics by 2867 members

General Questions

SilverStripe Forums » General Questions » Problem Symlinking Theme Assets

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 187 Views
  • _Matt
    Avatar
    Community Member
    24 Posts

    Problem Symlinking Theme Assets Link to this post

    I've set up a new site locally and have created a theme folder external to my webroot. I've then symlinked this theme into the correct location in the main site folder.

    The problem I'm having is that the '.ss' template files are being loaded without any problems, but none of the JS or CSS files are, I'm just getting a lot of 404 errors.

    In my terminal I can see that the symlink exists and works, and that all my assets are present and correct. There are no Apache or PHP errors being shown in my console, and I've made sure symlinking is allowed on the local host I've set up in MAMP.

    I've tried playing around with relative and absolute URLs, but nothing works.

    It's just very strange that the '.ss' files work, but nothing else...

    Can anyone help?

  • _Matt
    Avatar
    Community Member
    24 Posts

    Re: Problem Symlinking Theme Assets Link to this post

    Dub, newbie error!

    I'd forgotten to use the '$ThemeDir' (or is it '$TemplateDir', I forget?) variable in my asset paths. I.e. I was trying to symlink directly to 'styles/main.css', rather than 'themes/[my-theme]/styles/main.css'.

    Solved!

    187 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.