Search code examples
orchardcmsorchard-modules

Reuse same view across modules


This question is specific to Orchard CMS.

I have a partial view defined in a shared project. This partial view i would like to include in all the display views defined in other modules.

e.g Let's say I have a partial view with a label "Copyright information" defined in project "Shared". I add a new module in Orchard, in Display view i would like to include this view. Copyright label is just an example, my requirement is to reuse form elements across modules.


Solution

  • You can create your own shapes, then create templates for them in the views directory of your module. Other modules can then reuse those shapes if they take a dependency on the first module. They can even override templates if they need to. Your theme can also override templates.