how does template overriding work if >1 templates are in modules.

Topics: Customizing Orchard, Writing modules
Oct 12, 2012 at 7:48 PM

say i have a .cshtml file with the same name (eg. mytemplate.cshtml) in the views folder of 3 different modules.

What happens if i call @Display.mytemplate in another view ? Which module template will be used ? Is there any convention used by orchard as to which module wins  and provides the template ?

Better yet , is there a way i can define which module wins? For example each module have some sort of priority indicator and the one with highest priority wins in providing the template ?

Thanks 

Yiannis.

 

Coordinator
Oct 12, 2012 at 9:36 PM

It depends on dependency order. In general, try to choose good, unambiguous names for your views.

Oct 12, 2012 at 9:45 PM
Edited Oct 12, 2012 at 9:45 PM

thanks bertrand.

do you mean the dependency order of the visual studio project ? (on right clicking project --> Project dependencies dialog from visual studio) 

Coordinator
Oct 12, 2012 at 10:48 PM

No, the dependency order as defined in module manifests.