0
我是Umbraco的新手。我有一個名爲視頻的內容中的項目列表。每個項目都有一個特定的類別。我需要從每個類別中檢索「n」個項目。有人請幫忙。此外我正在使用MixItUp jquery插件來顯示項目。需要使用Umbraco在Razor中顯示每個類別的前n項物品
// this will bring up all items from the list
var items = Umbraco.TypedContent(Model.Content.Id).Children.Where(x => x.DocumentTypeAlias == "videoItem" && x.IsVisible());
// Here am trying to bring 5 items under category "Testimonial"
var allItems = items.Where(x => x.GetPropertyValue("category") == "Testimonial").Take(5);
但我沒有找到任何輸出。請幫忙。
我已經解決了我的問題。它需要鑄造。 var allTestimonial = items.Where(x =>(string)x.GetPropertyValue(「category」)==「Testimonial」)。 –