Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

Problem Symlinking Theme Assets


Go to End


2 Posts   1418 Views

Avatar
_Matt

Community Member, 29 Posts

5 March 2014 at 6:51am

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?

Avatar
_Matt

Community Member, 29 Posts

5 March 2014 at 7:33am

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! :)