Does anyone have an example or a link to some docs...
# package-development
k
Does anyone have an example or a link to some docs on what to do instead of the "PropertyEditorAsset" attribute when you want to add css/js files for custom property editors in newer versions?
d
Heyo! I think you just add your assets in the package manifest: https://docs.umbraco.com/umbraco-cms/extending/property-editors/package-manifest/
k
I'd love to do it in C# though. I know you can do it with a BackofficeCollectionBuilder from a composer, but I've seen other people using something called IManifestFilter but I haven't been able to find any docs that describe the recommended approach
d
That's also highlighted in the post that I linked 😄
This is the relevant part from the docs: Sample Manifest with Csharp You can also register your files by implementing a IManifestFilter instead of creating a package.manifest. Create a ManifestFilter.cs file and implement the IManifestFilter interface.
Copy code
csharp
public class ManifestFilter : IManifestFilter
{
    public void Filter(List<PackageManifest> manifests)
    {
        manifests.Add(new PackageManifest
        {
            PackageName = "Sir Trevor",
            Scripts = new[]
            {
                "~/App_Plugins/SirTrevor/SirTrevor.controller.js"
            }, 
            Version = "1.0.0"
        });
    }
}
Then add the ManifestFilter.cs to the CollectionBuilder.
Copy code
csharp
public class ManifestComposer : IComposer
{
    public void Compose(IUmbracoBuilder builder)
    {
        builder.ManifestFilters().Append<ManifestFilter>();
    }
}
k
Ah yes, I must have missed that. Thanks for that