How do I make a view model for a Block?

Vote:
 

I would like to add a list of objects to my Blocks view model, but I can't use my knowledge of making page view models to make block view models. How would I go about his?

#179611
Jun 16, 2017 8:28
Vote:
 

Take a look at the ContactBlockController in the Alloy templates, it creates a view model for the ContactBlock type.

You could also take a look right here: https://github.com/episerver/AlloyDemoKit/blob/master/src/AlloyDemoKit/Controllers/ContactBlockController.cs

#179613
Jun 16, 2017 10:36