volume_up

A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

volume_up

A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

Register custom ContentProvider

Hello everyone,

I'm trying to create my custom content provider.

I've created a class

namespace EPiServer.Templates.Alloy.CustomContentProviders
{
	public class CustomProvider : ContentProvider
	{
		protected override IContent LoadContent(ContentReference contentLink, ILanguageSelector languageSelector)
		{
			var page = DataFactory.Instance.Get<PageData>(new ContentReference(4));

			return page;
		}
	}
}

but when I tryed to register this provider in episerver.config I got this error

My configuration

  <contentProvider>
    <providers>
      <add name="CustomProvider"
              type="EPiServer.Templates.Alloy.CustomContentProviders, CustomProvider"
              entryPoint="165"/>
    </providers>
  </contentProvider>

EPiServer 7.5  with Alloy template

Does anybody know how can I fix it?

Thanks in advance

#86818
Jun 02, 2014 12:07

Error message:

Parser error message: unrecognized element 'contentProvider'

#86989
Jun 05, 2014 21:23
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.