Hello, just a short question. Is it possible to create a module directory where I can store all my extensions / modules rather than having everything in the root folder.
Thx
Thomas
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
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.
Hello, just a short question. Is it possible to create a module directory where I can store all my extensions / modules rather than having everything in the root folder.
Thx
Thomas
Yes you *could*, but you'll need to move all the content from your _config files into 1 _config file in /modules/_config.php. You might also have issues with CSS / image links in each module referencing /forums/css/* and any templates will need to be in your theme rather that the module file (since the template parser will only look for modulename/templates/.
So rather an extensive task which will involve editing alot of files.
ok u have just convinced me not to do something like that :)
I would prefer such a thing as well, since the root folder can become quite cluttered when dealing with lots of modules.
Maybe as an enhancement for a future version of SilverStripe?
@banal - see http://groups.google.com/group/silverstripe-dev/browse_thread/thread/a27d7f0013c33537/ac2cf816ebfce960?lnk=gst&q=directory+structure#ac2cf816ebfce960 for a discussion the core devs had a while back about the structure. Most of that discussion is still relavent I think.
here's a thought - your _config.php could scan sub dirs and include them automatically.. no need to move everything to one file.
@Willr thanks for that link. Sounds really interesting.
Do you know if there's any progress on this, since the discussion is older than one year? Might not be top priority, but would be nice nevertheless.
In the discussion they are also talking about symlinking one core to multiple projects. This works quite well already, even for modules (except for that damned Image.php class (afaik this is fixed in trunk, but not in 2.3.5)).
banal - It won't be changed for 2.4, It may be changed for 2.5 but I don't know of anything planned. It will might come at a similar time we implement a module manager in the cms since that would be a good time to tackle it but no plans yet.