Multiple modules in same project???

Topics: General, Writing modules, Writing themes
Apr 25, 2011 at 4:16 PM

Hi, again!!!

In need for Imagine Cup competition, I need to build a single module. The bad news is that I know that few days to deadline. Is it possible to put multiple modules in one project or better to put multiple modules in one nupkg file?

Also if this is not possible is it possible to put lets say in Controllers folder, folder Module1 with its controllers , etc... ? I have tried this approach but Views are not found if i have View/Module1/SomeView.cshtml ...

 

Thanks in advance,

Zlatibor Veljkovic!

Apr 25, 2011 at 4:43 PM

You can't put multiple projects in a nupkg unfortunately.

What you have to use is "Features" - you can define any number of features in you Module.txt and then use the [OrchardFeature("FeatureName")] attribute on any classes that belong to that feature. Unfortunately there's still no way to switch views on or off for features as far as I'm aware, and you just have to put them all in the Views folder.

For Module.txt feature examples just look at some of the built in modules like Orchard.DesignerTools.

Apr 26, 2011 at 12:10 AM

Thanks for information!

Apr 26, 2011 at 3:06 PM

In Features you can specify only a namespace not?

Apr 26, 2011 at 3:30 PM

A feature has a Name, and you can assign individual classes to that feature using the [OrchardFeature("FeatureName")] attribute.