I have a model that contains a parameter called CssClassName
like this:
[SitecoreType(TemplateId = "{51D5974A-7ABE-40C3-9EED-E32267C03112}", AutoMap = true)]
public class Separator
{
public virtual Guid ID { get; set; }
public virtual string Title { get; set; }
public virtual string CssColorClass { get; set; }
}
Now, from Sitecore side, this CssColorClass
parameter is a DropList
that points to a datasource where the template contains two parameters ClassName
and Description
. How can i tell the CssColorClass
to "grab" the ClassName
parameter and not the Item name of the items on the datasource?
On my razor view i have this:
@inherits Glass.Mapper.Sc.Web.Mvc.GlassView<MyModels.Models.Separator>
@using MyModels.Models
@using System.Web.Optimization
@{
Separator separatorModel = GetRenderingParameters<Separator>();
}
@Styles.Render("~/bundles/separator-css")
<h2 id="@separatorModel.ID" class="separator @separatorModel.CssColorClass">@separatorModel.Title</h2>