How to: Share a view over multiple themes?

Topics: Customizing Orchard, General, Writing themes
May 18, 2015 at 7:39 AM
Hey guys, I’m experimenting with a situation that uses the multi-tenancy module [not truly, as I only have the default tenant] - but the module is enabled so I can have multiple URI’s point to the same instance via the comma delimited host list]. From there I’m using a Theme Selector to render different sites uniquely. What I wish to know is, what is the best way to reference / reuse views from one theme [say, the main one] to multiple other themes?
Like, using the same alternate view in all the themes so I only have to edit once.

<Document.cshtml> - in Child.theme would contain [...ignore partial, this is just an example of intent]
@Html.Partial("../../Main.Theme/Views/Document", Model)

Or I assume there would be some method using shapes, which admittedly, I'm not very au fait with?
Ultimately, it would be nice to still be able to override the “possible solution” via alternates in the individual themes, if so needed.
Sorry if I’m not explaining myself concisely, but I hope you can piece together my ambitions and offer any advice, big thanks, Liv.
May 19, 2015 at 2:56 AM
Hmm, even when I read the above I'm a little perplexed sorry - so, what I'm aiming for is:


Main Theme
Views > Document.cshtml
//contains:
default orchard code


Theme 1
Views > Document.cshtml
//contains:
@Display(Main Theme Document Shape) //Somehow need to make Orchard's view engine locate the view file in the Main Theme or this one if there is an alternate [and shape view model]???


Theme 2
Views > Document.cshtml
//contains:
@Display(Main Theme Document Shape) //Somehow need to make Orchard's view engine locate the view file in the Main Theme or this one if there is an alternate [and shape view model]???

Theme 3 etc., etc.

So basically, all the other themes Document shapes derive from the Main Theme - hope that's a better explanation embarrassed
...any ideas or help will literally make my day, thanks all.
May 20, 2015 at 5:02 AM
Forgive my wayward notions - it appears I was trying to overcomplicate things...'one could just derive a child theme from the base, couldn't they blush' - thanks all, Liv