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

Module (Extension) directory ??


Go to End


8 Posts   895 Views

Avatar
teejay

Community Member, 63 Posts

11 February 2010 at 1:16pm

Edited: 11/02/2010 1:16pm

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

Avatar
Willr

Forum Moderator, 5523 Posts

11 February 2010 at 7:43pm

Edited: 11/02/2010 7:44pm

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.

Avatar
teejay

Community Member, 63 Posts

11 February 2010 at 7:48pm

ok u have just convinced me not to do something like that :)

Avatar
bummzack

Community Member, 904 Posts

11 February 2010 at 8:14pm

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?

Avatar
Willr

Forum Moderator, 5523 Posts

11 February 2010 at 8:43pm

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

Avatar
Hamish

Community Member, 712 Posts

11 February 2010 at 9:29pm

here's a thought - your _config.php could scan sub dirs and include them automatically.. no need to move everything to one file.

Avatar
bummzack

Community Member, 904 Posts

11 February 2010 at 9:49pm

@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)).

Avatar
Willr

Forum Moderator, 5523 Posts

11 February 2010 at 10:08pm

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.