One module version for both, orchard 1.3 and 1.4

Topics: Writing modules
Mar 21, 2012 at 6:58 AM


The problem that I currently have, is that I have a module, which works ok in orchard version 1.3, but has some issues in 1.4.

I have the workaround for 1.4, but when I apply it, then the orchard 1.3 version doesn't compile.

Is there a possibility to have the same module to work in both orchard versions?

Mar 21, 2012 at 8:14 AM

Well, I think the gallery needs a good overhaul to support multiple orchard versions in the future and other things... For now, for you, I don't know a proper solution.

Mar 21, 2012 at 8:36 PM

Found a solution. Actualy when orchard is compiling modules at the start of the application, it adds a compiler directive called ORCHARD_{majorversion}_{minorversion}, which can be used inside modules to make distinction between previous versions.

So, for orchard 1.4 there is a compiler directive ORCHARD_1_4 which can be used using #if directive.

Mar 21, 2012 at 10:59 PM
Edited Mar 21, 2012 at 11:00 PM

Oh I wasn't aware, guess I made a ticket for this for nothing then :s

Edit: Well my ticket isn't completely useless as I'd like to see more options (like ORCHARD_1 ORCHARD_1_4_1 etc.. you get the idea)