Quantcast
Channel: Developer to developer
Viewing all articles
Browse latest Browse all 9076

Creating Episerver Blocks out of standard C# Classes

$
0
0

Hi,

We're trying to integrate external components into Episerver blocks. Below is an example of this with standard classes.
Do we have to write custom adapters for each component class to convert them into Episerver blocks, or is there a way to do that with Episerver out of the box?

[ContentType(DisplayName = "Carousel", GUID = "23c1b825-0ddf-47b1-a30c-735e1b88d8ad", Description = "")]
    public class CarouselBlock : BlockData
    {
        public virtual Carousel Carousel { get; set; }
    }
   public class Carousel
    {
        public List<CarouselItem> Items { get; set; }
        public int StartIndex { get; set; }
    }
   public class CarouselItem
    {
        // Map to image?
        public string Url { get; set; }
       // Map to link?
        public string Link { get; set; }
    }

Executing the code above gives us the following error:

Type 'Models.Blocks.Carousel' could not be mapped to a PropertyDefinitionType

Thanks!


Viewing all articles
Browse latest Browse all 9076

Trending Articles