Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi Im trying to inject UmbracoHelper in my custom field. But i get this error:
Cannot consume scoped service 'Umbraco.Cms.Web.Common.UmbracoHelper' from singleton 'xxx.Forms.MyCustomField'.)
I did follow this: https://docs.umbraco.com/umbraco-forms/developer/extending/adding-a-fieldtype
Why can't I do that? I need loop some published content. to check if some content id's exist.
I ended up doing this instead:
var accessor = StaticServiceProvider.Instance.GetRequiredService<IUmbracoHelperAccessor>(); if (accessor.TryGetUmbracoHelper(out var umbracoHelper)) { var contentnode= umbracoHelper.Content(1234); }
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
UmbracoHelper in Custom field
Hi Im trying to inject UmbracoHelper in my custom field. But i get this error:
Cannot consume scoped service 'Umbraco.Cms.Web.Common.UmbracoHelper' from singleton 'xxx.Forms.MyCustomField'.)
I did follow this: https://docs.umbraco.com/umbraco-forms/developer/extending/adding-a-fieldtype
Why can't I do that? I need loop some published content. to check if some content id's exist.
I ended up doing this instead:
is working on a reply...