OrchardCore
OrchardCore copied to clipboard
Upload Theme Packages
I think Orchard Core really needs the ability to upload a theme package if it is to compete with other CMS’s on the market. I am just going to take a stab at a possible implementation.
- Create a built in Stub Theme which would be empty and have no views or anything at all
- The Stub Theme would NOT be selectable or visible from UI
- Users would upload a compressed theme package file with views and icons and config file and whatever else is needed.
- When someone chooses to make an uploaded theme their current theme, Orchard would set the Stub Theme to the current theme.
- Obviously, nothing would show up because the stub theme is empty
- This is where the package file comes in.
- When on the Stub Theme, assuming there is a cascading algorithm, then you would change the algorithm to look for the view in the package file first before cascading downwards.
- I assume the current package file would need to be cached for performance issues
- Maybe you do not even need a stub theme?
You guys would know best how to implement it. This is just to communicate the idea. considered.
Something similar was available for Orchard 1 both for modules and themes. I've never really seen the appeal though: installing a plugin into your deployed app on the fly is very risky. Then you also have to somehow have a downstream option to keep these plugins by e.g. somehow exporting them, so you can move the site's configuration to another place like running it locally.
If Orchard would be an app that you just use, even if you host it yourself, like TeamCity, I'd agree this could be useful. However, Orchard is rather used as an application platform where you also develop your own app with it.
This could potentially work if we would/could be using Admin Liquid Templates for everything. Then the assets could also be editable through the media gallery or something like it.
Let's say we start from a "blank" frontend theme. All we would need is create a recipe that creates Liquid templates stored in the DB. And bundle some assets in a .rar file? That's how for example Shopify works ... So, in this case we don't talk about changing the server side theme but to allow to edit the current one from the admin UI.
BTW Lombiq Hosting - Media Theme for Orchard Core is something like what you envision.
For all intents and purposes, the previously linked Media Theme covers this. I don't think we'll ever have a feature to upload actual theme packages with C# code files, since that would entail modifying and recompiling the application while it's running, which while technically possible, would be risky and also unnecessary due to what I've written under https://github.com/OrchardCMS/OrchardCore/issues/8346#issuecomment-764017223.
What's that's not covered for you by Media Theme, the built-in way of editing templates (and uploading CSS/JS files) from the admin, or by the GrapeJS HTML Editor?
Related: https://github.com/OrchardCMS/OrchardCore/issues/3279
Regardless of security, if you want to develop this feature, you can refer to this code.
https://github.com/EasyOC/EasyOC.Modules/blob/main/src/Modules/EasyOC.AssemblyLoader/ExternalModuleNamesProvider.cs
It seems that this issue didn't really move for quite a while. Is this something you'd like to revisit any time soon or should we close? Please reply.
Closing this issue because it didn't receive further feedback from the author for very long. If you think this is still relevant, feel free to reopen it with the requested details.