How to override Razor Class Library (RCL) content?
I've used these articles to convert my custom packages to Razor Class Libraries (RCL). I'm struggling with overriding the RCL content though. It should be possible to override RCL content by putting a physical file in the folder structure of the website project. I've been testing this with a really simple 'hello world' property editor package. This package contains an index.html view in the root of the package folder structure. But when I add a physical file to the Umbraco v10 website project (/App_Plugins/HelloWorldPackage/index.html) and make some changes to this file, these changes are not reflected in the Umbraco backoffice. It still shows the RCL version of the view. Any idea what I could be doing wrong?
I am not sure the static files are overridden in the same way as compiled razor views are in a RCL - but it might still work if you put them in a diffrent location .
i would try wwwroot/app_plugins/hellowworldpackage/index.html as i think that is the first place the site will actuall look, it might be that the Umbraco file provider that allows you to use the /app_plugins folder is actually below the razor one in the list
Hey Kevin, thanks for the input! I already tried putting the file in /wwwroot/App_Plugins/HelloWorldPackage/index.html, but that doesn't work either, as in the RCL version is still being used. Plus when I do that I can't publish the site anymore, because that results in the following error:
Conflicting assets with the same target path 'App_Plugins/HelloWorldPackage/index.html'. For assets 'Identity: D:\Dev\UmbracoPackageRCL\src\HelloWorldPackage\wwwroot\index.html, SourceType: Project, SourceId: HelloWorldPackage, ContentRoot: D:\Dev\UmbracoPackageRCL\src\HelloWorldPackage\wwwroot\, BasePath: App_Plugins/HelloWorldPackage, RelativePath: index.html, AssetKind: All, AssetMode: All, AssetRole: Primary, RelatedAsset: , AssetTraitName: , AssetTraitValue: , CopyToOutputDirectory: Never, CopyToPublishDirectory: PreserveNewest, OriginalItemSpec: wwwroot\index.html' and 'Identity: D:\Dev\UmbracoPackageRCL\src\Umbraco.Cms.10x\wwwroot\App_Plugins\HelloWorldPackage\index.html, SourceType: Discovered, SourceId: Umbraco.Cms.10x, ContentRoot: D:\Dev\UmbracoPackageRCL\src\Umbraco.Cms.10x\wwwroot\, BasePath: _content/Umbraco.Cms.10x, RelativePath: App_Plugins/HelloWorldPackage/index.html, AssetKind: All, AssetMode: All, AssetRole: Primary, RelatedAsset: , AssetTraitName: , AssetTraitValue: , CopyToOutputDirectory: Never, CopyToPublishDirectory: PreserveNewest, OriginalItemSpec: wwwroot\App_Plugins\HelloWorldPackage\index.html' from different projects.
I think you're right in that static files don't work the same way as compiled razor views in a RCL. That would be a bummer though, because you wouldn't be able to customize/hack existing RCL packages when needed.
How to override Razor Class Library (RCL) content?
I've used these articles to convert my custom packages to Razor Class Libraries (RCL). I'm struggling with overriding the RCL content though. It should be possible to override RCL content by putting a physical file in the folder structure of the website project. I've been testing this with a really simple 'hello world' property editor package. This package contains an index.html view in the root of the package folder structure. But when I add a physical file to the Umbraco v10 website project (/App_Plugins/HelloWorldPackage/index.html) and make some changes to this file, these changes are not reflected in the Umbraco backoffice. It still shows the RCL version of the view. Any idea what I could be doing wrong?
Here's the repo: https://github.com/creativesuspects/UmbracoPackageRCL
Hi,
I am not sure the static files are overridden in the same way as compiled razor views are in a RCL - but it might still work if you put them in a diffrent location .
i would try
wwwroot/app_plugins/hellowworldpackage/index.html
as i think that is the first place the site will actuall look, it might be that the Umbraco file provider that allows you to use the/app_plugins
folder is actually below the razor one in the listHey Kevin, thanks for the input! I already tried putting the file in /wwwroot/App_Plugins/HelloWorldPackage/index.html, but that doesn't work either, as in the RCL version is still being used. Plus when I do that I can't publish the site anymore, because that results in the following error:
I think you're right in that static files don't work the same way as compiled razor views in a RCL. That would be a bummer though, because you wouldn't be able to customize/hack existing RCL packages when needed.
is working on a reply...