0

I have an entity type "Post" and I would like to create a view that will show one random Post with a given category. I created a Data pipeline that grabs all posts and I created a view with ListPresentation = a "TemplateSettings" entity type that lets me choose categories.

I planned to use the Razor template to filter the items for those matching the categories in List.Presentation.Categories. But, I can't seem to reference List.Presentation.Categories. I get an error that System.Collections.Generic.List doesn't contain an entry for "Presentation". When I use @ListPresentation, the whole object in null... so @ListPresentation.Toolbar, etc. all throw errors, despite me having set a "Demo Item".

Can anybody see what would be wrong with this setup? How do I reference List Presentation stuff in Razor?

Thanks.

Mike
  • 107
  • 7

2 Answers2

0

I figured this out... The direct thing seems to be "ListPresentation", but the snippets use "List.Presentation". Still, it wasn't working in my case because I was using a data query that didn't include the module data. So, I had to modify that query to include the module data as well as the full list of entities, regardless of the module. Then, I got the full list from one data stream, and the ListPresentation fields were available.

Mike
  • 107
  • 7
0

Note also that you can use ListContent.Presentation - that would be the newest, most consistent API which always places Presentation information as a property of the entity it's describing.

iJungleBoy
  • 5,325
  • 1
  • 9
  • 21