I'm trying to créate a carousel and i have a PlayerCard
model that will work as a slide for my carousel. Then i have an interface ICarousel
that has the main fields of the carousel and a PlayersCarousel
that will implement the interface.
Something like this:
[SitecoreType(TemplateId = "{5B0B5442-D005-49A1-84DD-56788DCCD315}")]
public class PlayersCarousel : SitecoreGlassMap<ICarouselV2>
{
public virtual IEnumerable<PlayerCard> Items { get; set; }
public override void Configure()
{
Map(x=> x.AutoMap());
}
}
public interface ICarouselV2
{
string BackgroundColor { get; set; }
bool IsArrowHidden { get; set; }
bool IsBulletHidden { get; set; }
int AnimationTime { get; set; }
int ItemsPerSlide { get; set; }
}
Now, the PlayerCard
is an ítem on sitecore that is mapped to a view rendering (named Player Card
).
The razor view PlayersCarousel.cshtml
will have this:
@inherits GlassView<PlayersCarousel>
@using ConexioFC.Models
@*------ I don't know what goes here--------*@
My question is how do i map the Ítems
property of PlayersCarousel
with the view rendering Player Card
?
I'm using Glass.Mapper v4 with all this.