rickbutterfield
09/18/2023, 11:14 AMApp_Plugins/Umbraco.Community.BlockPreview/views/
. I can't figure out how to get the best of both worlds here as I'd need something like a targets file that only copies one file, is that right? Or does this defeat the purpose of an RCL?Ronald Barendse
09/18/2023, 11:38 AMWebRootFileProvider
and the Razor one will be compiled (so the source file won't be included).
Also: Razor views can be overwritten by adding your own source code in the same place, but static assets like HTML will cause duplicate errors when building/publishing...Ronald Barendse
09/18/2023, 11:39 AMMatt Wise
09/18/2023, 11:40 AMrickbutterfield
09/18/2023, 11:41 AMRonald Barendse
09/18/2023, 11:54 AMIPhysicalFileSystem
and not the WebRootFileProvider
to get all files (probably because some file pickers also allow uploading new files and IFileProvider
is read-only)... So that means it only shows actual physical files on disk.
That essentially means you still need to copy over the file using the MSBuild target, although you can ship the rest of the files inside the RCL. So you indeed have to create a hybrid that uses a customized build target from https://github.com/umbraco/Umbraco-CMS/tree/contrib/templates/UmbracoPackage and the project setup from https://github.com/umbraco/Umbraco-CMS/tree/contrib/templates/UmbracoPackageRcl 🙃D_Inventor
09/18/2023, 12:14 PMD_Inventor
09/18/2023, 12:14 PMD_Inventor
09/18/2023, 12:15 PMcsharp
public class BlockPreviewTreeRenderingNotification : INotificationHandler<TreeNodesRenderingNotification>
{
public void Handle(TreeNodesRenderingNotification notification)
{
if (!string.Equals(notification.TreeAlias, "staticFiles", StringComparison.Ordinal)
|| !string.Equals(notification.Id, Constants.System.RootString, StringComparison.Ordinal)) return;
notification.Nodes.Add(new TreeNode("App_Plugins%2fblockpreview%2fblock-preview.html", null, null, null)
{
HasChildren = false,
Icon = "icon-document",
Name = "block-preview.html",
ParentId = "-1",
});
}
}
D_Inventor
09/18/2023, 12:16 PMName
property ends with .html
.rickbutterfield
09/18/2023, 12:35 PMMatt Wise
09/18/2023, 12:47 PM