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.

Installing SilverStripe /

Getting SilverStripe up and running on your computer and on your web server.

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

Directory layout and modules subfolder?


Go to End


3 Posts   1471 Views

Avatar
Talbet

Community Member, 7 Posts

30 May 2015 at 3:56pm

I've just started using SilverStripe and it's been a smooth learning curve, thanks to great documentation. One thing I was wondering though, has anyone had any success putting modules in a subfolder? As long as there is a _config.php in the subfolder, the php classes get picked up in the manifest, but static assets, such as images and css all seem to depend on having the module in the webroot directory.

I was hoping to do this to simplify the structure of the site for our designers, having a 'mysite' directory and 'modules' directory would be much cleaner and less confusing.It would also make .gitignore management a lot easier. It would be great to know if anyone else has tried this?

Avatar
Pyromanik

Community Member, 419 Posts

1 June 2015 at 11:06pm

There is a module somewhere as a proof of concept with (maybe somewhat limited) success.
I could write a diatribe on my personal views on this, but the above should answer your question.

A longer answer is no, due to the encapsulation of a module & all it's working parts. Consider all the files in modules that need direct routes to be provided, most specifically things not controlled by Requirements (like images).

So yes there are hacks, but no it's not 'a thing'.

Avatar
Talbet

Community Member, 7 Posts

2 June 2015 at 3:22pm

Thanks for the info. If you can remember the name of the module, I'd be interested in having a look, but don't worry if not. I was more interested in opinions on wether it was a good idea or not. Silverstripe is a very flexible framework, but the conventions that are there seem to be for a good reason.