November Happy Hour will be moved to Thursday December 5th.
AI OnAI Off
November Happy Hour will be moved to Thursday December 5th.
The ICategorizable interface although implemented implicitly in PageData isn't implemented for BlockData as blocks can be used not only as page components for as shared properties areas. Therefore they are composed at runtime via Castle Winsor Proxies.
To gain access to a block's Category propery simple cast it to ICategorizable such as
var categoryCurrentBlock = (ICategorizable)currentBlock;
Although I would recommend doing things like this in a Controller and passing a ViewModel to the cshtml file.
In my block, authors have the ability to add categories. How do i access this in the cshtml/view page?
Tried. Model.CurrentBlock. ...but it doesn't have any "category" property.