Umbraco.Forms.Issues icon indicating copy to clipboard operation
Umbraco.Forms.Issues copied to clipboard

Add support to distribute custom forms themes as part of a Razor class library

Open jhenkes opened this issue 3 years ago • 1 comments

Hello,

I noticed that Umbraco Forms v10 distributes the .cshtml files (including themes) as part of a Razor class library. Would it be possible / Is it planned to also support the same mechanism for custom themes as part of a RCL?

I currently have a custom forms theme for bootstrap 5. Instead of having to add the physical files to every project I want to use this theme in, I'd like to distribute it as RCL.

Best regards, Jeremy

jhenkes avatar Jun 29 '22 14:06 jhenkes

We have a similar setup where we want to have a .cshtml as part of a Razor class library. For us the .cshtml file is a email template. We configured the RCL for Razor pages. Sadly the email template does not show up in the template picker when using the SendRazorEmail workflow.

FrankSchutte avatar Dec 19 '22 15:12 FrankSchutte

+1

We are using Umbraco Cloud, where it is "best practice" to not mess with the default "UmbracoProject" but instead built customizations, components, extensions, etc. in separate projects (I would anyway, even if it wasn't recommended, FYI), then have the "UmbracoProject" reference the other projects as dependencies. It seems pretty silly that Umbraco Form's themes don't work correctly when included in an RCL. One fun thing to note, however: if you build your custom theme in an RCL project, but put it in a folder called "default" its works beautifully.

It also seems silly to me that the Umbraco.Forms.Web.Api.ManagementApi.Theme.GetCollectionController, which uses DI for the ioHelper, loggerFactory, hostingEnvironment, and hostEnvironment doesn't also use DI for "PhysicalFileSystem", thereby giving developers the options to swap out where the theme files come from. I am sure there is a good reason for this, but it escapes me.

gmanrodt avatar Oct 03 '24 19:10 gmanrodt

Thanks for the nudge on this one. I've been looking into this today and can see we have a way to include themes and email templates from RCLs, so we'll include this in the upcoming releases.

AndyButland avatar Oct 04 '24 12:10 AndyButland