gregor.tusar
02/05/2024, 8:05 AMhelp-with-umbraco (https://discord.com/channels/869656431308189746/1201498769997443122) but I'll try also here:
We are building a package that has a custom .html view for property editor. We added the .html file under wwwroot/App_Plugins/Company.Plugin/customView.html.
The package gets installed in solution successfully but after we try to select this view for a element of a block grid, the custom view cannot be selected from the file tree.
It looks like the content of the wwwroot does not actualy copy to the output directory.
However, if the view is hardcoded in a Data Editor it works somehow. It is also accessible via URL.
How to select the custom property editor view for a data editor if it is installed via plugin?
https://cdn.discordapp.com/attachments/882984798719729704/1203974583963746344/image.png?ex=65d30bb5&is=65c096b5&hm=a7f68b28f99634b406fd33dfeeb1225cdd5eb2ac2fe0d0471b9de157da063701&D_Inventor
02/05/2024, 11:35 AMgregor.tusar
02/05/2024, 12:57 PMgregor.tusar
02/05/2024, 12:59 PM.targets or .csproj command, that would copy the .html to site's wwwroot folder, but I think this is not ok, since there are then 2 files in the solution that are basically the same.gregor.tusar
02/05/2024, 1:02 PMDataEditor that has fixedly defined EditorView inside
[DataEditor(EditorAlias, EditorTypeEnum, EditorName, EditorView, Group = EditorGroup, Icon = EditorIcon, ValueType = EditorValueType)]
public class MyDataEditor : DataEditor
{
internal const string EditorView = "~/App_Plugins/MyPlugin/MyDataEditor.html";
...<omitted for brevity>...
}
this finds the view normally, even though it is not physically in sites wwwroot or App_Plugins folders, but only in plugins project wwwroot folder.Mike Chambers
02/06/2024, 9:51 AMD_Inventor
02/06/2024, 10:05 AMD_Inventor
02/06/2024, 10:07 AMcsharp
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",
});
}
}gregor.tusar
02/07/2024, 7:55 AMD_Inventor
02/07/2024, 11:46 AMgregor.tusar
02/13/2024, 2:51 PMcsharp
public class TreeComposer : IComposer
{
public void Compose(IUmbracoBuilder builder)
{
builder.Trees().RemoveTreeController<StaticFilesTreeController>();
builder.Trees().AddTreeController<CustomStaticFilesTreeController>();
}
}
https://cdn.discordapp.com/attachments/1203974584227991552/1206975885261938698/message.txt?ex=65ddf6e3&is=65cb81e3&hm=8bad0d5ebccf4ad985a1e0da2d1ae3dea5f8d735869a5a75b9abeb66b76f98cc&A hub and casual space for you to interact with fellow community members and learn more about Umbraco!
Powered by