Jan 28, 2015 at 5:52 PM
Edited Jan 28, 2015 at 5:55 PM
I have a content part with the following Display function
protected override DriverResult Display(BannerWidgetPart part, string displayType, dynamic shapeHelper)
var publishedBannerItems = _contentManager.Query(VersionOptions.Published, "BannerItem").List();
List<string> publishedBannerItemList = new List<string>();
foreach (var bannerItem in publishedBannerItems)
part.CurrentBannerPath = publishedBannerItemList;
part.PreviousBannerPath = publishedBannerItemList;
() => shapeHelper.Parts_BannerWidgetPart(Model: part));
My Editor does not do anything to set the values for this part as it doesn't require user input. I'm just grabbing a list of image paths that are connected to a published banner item and then setting the part's values to a random path (currently I've just hard
coded the value to whatever is the first item in the list instead of randomizing it - one step at a time). When I do this however the value is null when I try to access it in the view using
am I missing something? I've never tried to set the values of a part in the database this way as I usually need to use the editor view to accept input from the user for the
values in which case I use razor's textboxfor and similar items. Thank you.
Edit: I have run the debugger and part.CurrentBannerPath and part.PreviousBannerPath both have a string value "/Media/Default/Banner%20Images/masthead%20(1).jpg"