Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Hello,
We have implemented a custom content provider with load, search and listing parameters. We mainly use it with a custom widget to get images and videos from an external API into a page. So far so good.
My question is - how can I use the content provider from a custom Page? Let's say I'd want to do something like searching the content provider for a certain query and always displaying the latest result, or hard-core an external content ID to display on a page.
Would I use the content provider directly in a page's controller, and/or do some config and registration to make that sort of thing work?
The content provider has the following interface:
public class MyCustomProvider : EPiServer.Core.ContentProvider { public static string Key = "custom_provider"; //... // ICustomMedia implements IContent public IEnumerable<ICustomMedia> Search(string query) { //... } protected override IContent LoadContent(ContentReference contentLink, ILanguageSelector languageSelector) { //... } protected override IList<GetChildrenReferenceResult> LoadChildrenReferencesAndTypes( ContentReference contentLink, string languageID, out bool languageSpecific) { //... } // .. }