OC MultiTenant MultiTheme Resources and Static Files #10578
-
The most simple example of what I can't get working is as follows: OC site, using Razor, multiple modules, multiple tenants, two themes. ThemeA, ThemeB. Both themes have site wide styles, images, and scripts. When the user logs in, they are at the InfoModule. The info module has a generic class of object. Each theme styles this object differently. In the object, an IMG tag has a source that exists in both themes, each with their own version. A logo, for example. If ThemeA is active, the relative path to the image is /ThemeA/images/logo.png. If ThemeB is active, the relative path to the image is /ThemeB/images/logo.png. How can I set the proper relative path in the module to the logo, without having to specify the theme's path? Resource manifests require uniqueness, based on what I read, so I cannot have the module find the static file that way. How do i do I make a static file reference correctly? Is there a way to automatically prepend the IMG's SRC with the the theme name? Something like src="[email protected]/images/logo.png"? I am unclear how to accomplish this? An example to look at would be very helpful. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
What I would suggest (without seeing your codebase) Modules are designed to be themable, by a theme. So the theme, when it is styling the The info module might know that an image should exist (but I would say it probably shouldn't) I'm not sure if you've done this with shapes, or razor pages. But in my opinion the thing that is rendering the InfoModule should be in the theme, so the theme can style it. Or you need some kind of provider, that the theme(s) implement to provide a img url. Hopefully that's some ideas to get you going again. |
Beta Was this translation helpful? Give feedback.
What I would suggest (without seeing your codebase)
Modules are designed to be themable, by a theme.
So the theme, when it is styling the
InfoModule
should be the one providing it's path to the image.The info module might know that an image should exist (but I would say it probably shouldn't)
I'm not sure if you've done this with shapes, or razor pages.
But in my opinion the thing that is rendering the InfoModule should be in the theme, so the theme can style it.
Or you need some kind of provider, that the theme(s) implement to provide a img url.
Hopefully that's some ideas to get you going again.