-
If two themes exist, ThemeA & ThemeB, and each has a different image with the same name and path (ex: wwwroot/images/noprofile.jpg ), and a module exists ( ArtistsModule), and in that module, in the Views/Home/index.cshtml there is something like the following.
What's the point of themes? Do we have to do a resource for everything? one image is not a problem, but what about a professional theme which may hundreds of images? Do we have to use tags for the page to resolve? Right now, everything is pointing to a requirement that the theme name be in the url, for example src="/ThemeA/images/noprofile.jpg" Is there an elegant way to take the static files in multiple themes and have them answer to the same path, depending on which one is active? Perhaps with a MapWith weighing the path "/images" with a class that provides the current theme "ThemeB".. So perhaps something like
And if this is the case, where do you do it? This is all standard dotnet - but if every theme ThemeA and ThemeB BOTH was to map "/images" to THEIR wwwroot, this is a problem. The first to map will get it, I believe? I feel like there's something really important I'm missing, something very basic and fundamental. Because I'm struggling to see how I can make a module with content on his, and have each tenant have a theme with a very large number of static files. Thanks in advance for any advice or insight here, because I really want to understand this. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Static assets from a module are always resolved with an assembly path. Here, each module or theme is equivalent to an MVC Area. So, unless you put your assets in a wwwroot folder of that module or theme, static assets are always embedded inside the assembly, this is why you resolve their path with the module or theme name. As you said, that's all standard ASP.NET MVC.
The last module/feature registered by the DI wins.
No.
Probably you want to have a static file provider that uses the tenant name as a prefix to resolve these files. That way, it will be the same path for each theme. https://docs.orchardcore.net/en/dev/docs/reference/modules/Tenants/#static-file-provider-feature You can also use the Media Gallery which will resolve to the /media folder of each of your tenants. This by using https://docs.orchardcore.net/en/dev/docs/reference/modules/Media/#razor-helpers |
Beta Was this translation helpful? Give feedback.
Static assets from a module are always resolved with an assembly path. Here, each module or theme is equivalent to an MVC Area. So, unless you put your assets in a wwwroot folder of that module or theme, static assets are always embedded inside the assembly, this is why you resolve their path with the module or theme name. As you said, that's all standard ASP.NET MVC.