This project is read-only.

A different per Tenant applied in TheAdmin

Topics: Customizing Orchard, Writing modules
Mar 5, 2014 at 12:31 AM
I have several sites that share content types and functionality.
A few sites had customizations in the of TheAdmin to control fields that appear in the AdminSummary shape.

We've recently moved to use multitenancy. And I'm looking for how I can maintain the same functionality. I have a very hack-ish module in place, which does the trick, but definitely is not elegant in the least.

Mar 5, 2014 at 12:49 AM

Might be doable. Can you try in the PlacementParser ? or something related
Mar 5, 2014 at 3:37 AM
In my failed module, I tried to provide my own IShapeTableProvider based on ShapePlacementParsingStrategy.
I was hoping to provide something I can set via a setting, particularly so I can test different configuration with ease in development.
But I've been thwarted by the caching in DefaultShapeTableManager, I couldn't find how to add a purge to the IParallelCacheContext.

But ok.. I can definitely modify the ShapePlacementParsingStrategy to use a different convention...

So in any theme/module if a Plcement.{tenant}.info is found, it will be used instead of a in the same module.

Does anyone else want/need this?
Mar 5, 2014 at 10:32 PM
Interesting, but can't you use a different admin theme for each of the tenants? Might be an overkill just for placement but this is the approach with standard themes.
Mar 6, 2014 at 4:44 PM
It felt like overkill at first
But looking at what I have to do in the other direction, It sounds more palatable.

What I do like about it is that it is a bit more testable from a developers standpoint.
I can switch between admin themes programmatically easier than i can change the active file.
I think I'm going to go with this instead.

Dose "Theme Inheritance" work with TheAdmin?
Mar 6, 2014 at 6:09 PM
Good then. I don't know about base themes for admin themes, but you can be a pioneer to find it out :-).
Mar 6, 2014 at 8:18 PM
Edited Mar 6, 2014 at 8:29 PM
And a new <Match Tenant='xxxx',yyyy,zzzz'> keyword in ?
Mar 7, 2014 at 1:16 AM
You can already do that actually, with just a ThemeSelector. You could base the used theme on the current tenant, with fallback.
Mar 7, 2014 at 7:22 AM
sebastienros wrote:
You can already do that actually, with just a ThemeSelector. You could base the used theme on the current tenant, with fallback.
I can confirm that this works as we are using this solutions on our setup. We have themes for admin-side based on TheAdmin-theme and we just set themeselector with higher prio and it kicks in as intended. We can then override on our themes what we want to replace or add things based on TheAdmin-theme.