OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.36k stars 2.37k forks source link

Upload Theme Packages #8346

Closed JoshTango closed 3 months ago

JoshTango commented 3 years ago

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.

  1. Create a built in Stub Theme which would be empty and have no views or anything at all
  2. The Stub Theme would NOT be selectable or visible from UI
  3. Users would upload a compressed theme package file with views and icons and config file and whatever else is needed.
  4. When someone chooses to make an uploaded theme their current theme, Orchard would set the Stub Theme to the current theme.
  5. Obviously, nothing would show up because the stub theme is empty
  6. This is where the package file comes in.
  7. 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.
  8. I assume the current package file would need to be cached for performance issues
  9. 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.

Piedone commented 3 years ago

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.

Skrypt commented 3 years ago

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.

Piedone commented 1 year ago

BTW Lombiq Hosting - Media Theme for Orchard Core is something like what you envision.

Piedone commented 4 months ago

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

hyzx86 commented 4 months ago

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

github-actions[bot] commented 3 months ago

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.

github-actions[bot] commented 3 months ago

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.