Creating an RCL to serve the entire /Views/ folder...
# help-with-umbraco
c
So deliberating with a colleague today on the possibility for an Umbraco site to have its entire /Views/ directory actually served by an RCL instead of needing to build views within the web solution itself. Was wondering if anyone had achieved anything close to this or might be aware of pitfalls of trying to achieve this? Ultimately trying to level up our "Baseline" on Umbraco cloud in such a way that on a per project basis - Views could be overridden without the worry that an accidental push from the parent project could wipe out a custom view that was created (Or wipe a customisation made to a view that was originally served by the baseline parent project)
m
not sure.. but might be an issue with how umbraco expects templates via the bakoffice to work.. have a feeling it's a requirement for a physical file on disk? https://github.com/umbraco/Umbraco-CMS/blob/contrib/src/Umbraco.Core/Services/TemplateService.cs#L102-L115 https://github.com/umbraco/Umbraco-CMS/blob/contrib/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/TemplateRepository.cs#L508-L528 though you might not be bothered about backoffice template/partial manipulation.... but could be a deeper association with onDisk requirement?
rather than RCL could you not do someting a little more manuall.. with conditional setting of the layout in the view to check for override path file exists?
c
@Mike Chambers Hey Mike, Good to know! Yeah i completely forgot you can edit the templates / partials in the backoffice, its been so long since ive editted files that way I forgot it was even a thing! Yeah the other alternative I was thinking of was creating an override for .nets default view finder and adding like a route to /Views/{ThemeName}/RestOfPath and having that be the first one try to resolve. Could then create some little Json config to extend {ThemeName} with as many potential options as needed
6 Views