|
Hi There
I have a created a custom widget that will receive data from a custom handler that will render the custom widget\shape.
I am able to get the fields data in the view but I would like to pass all the data to the view as Json as I am going to be using Backbone to filter the data.
Here is what I currently have .
protected override void BuildDisplayShape(BuildDisplayContext context)
{
base.BuildDisplayShape(context);
if (context.ContentItem.ContentType == "NavigationWidget")
{
var VehicleRanges = _contentManager.Query<VehicleRangePart, VehicleRangePartRecord>("VehicleRange").List();
//TODO add select statement to return Field data
dynamic packageDisplay = _orchard.New.NavigationWidgetInfo(
Ranges: VehicleRanges //TODO RETURN RANGE AND VEHICLE DATA AS JSON
);
context.Shape.NavigationWidgetInfo = packageDisplay;
}
View
@foreach (var m in Model.Ranges)
{
var Navimage = m.ContentItem.VehicleRange.NavigationImage.Url;
var Fitermage = m.ContentItem.VehicleRange.FilterImage.Url;
- @m.Name
- NAV IMAGE: @Navimage
- Filter IMAGE: @Fitermage
}
My question is how to I get to the
.NavigationImage.Url .FilterImage.Url
properties in the Handler
Thanks Stanton
|