A different placement.info per Tenant applied in TheAdmin

Topics: Customizing Orchard, Writing modules
Mar 4 at 11:31 PM
I have several sites that share content types and functionality.
A few sites had customizations in the Placement.info 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.

Suggestions?
Coordinator
Mar 4 at 11:49 PM
placement.{tenant}.info

Might be doable. Can you try in the PlacementParser ? or something related
Mar 5 at 2: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 Placement.info in the same module.
Agreed?

Does anyone else want/need this?
Developer
Mar 5 at 9: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 at 3: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 placement.info file.
I think I'm going to go with this instead.

Dose "Theme Inheritance" work with TheAdmin?
Developer
Mar 6 at 5: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 at 7:18 PM
Edited Mar 6 at 7:29 PM
And a new <Match Tenant='xxxx',yyyy,zzzz'> keyword in Placement.info ?
Coordinator
Mar 7 at 12: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 at 6: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.