Quick follow up - how would I target a custom view so I can use different structure for different blocklists - so I've got the default.cshtml for one and user custom.cshtml for another?
Figured this out - use this instead of the html helper! Sorted.
@foreach(var blockItem in Model.MyProperty) {
var blockItemContent = (ContentModels.MyElementTypeAlias)blockItem.Content;
<h2>@blockItemContent.MyBlockProperty</h2>}
This is also useful for nesting Blocklists within blocklists.
Cheers
Add class to block list output div.
I would like to append a class to the div that's output by the new Umbraco 11 block list editor.
to become
Any idea on how this might be done?
Thanks in advance. Darren
The default Umbraco Blocklist editor is outputted at
/Views/Partials/blocklist/default.cshtml
You can add your own class by appending a new value to
class="umb-block-list"
Brilliant, thanks James for the prompt response.
Quick follow up - how would I target a custom view so I can use different structure for different blocklists - so I've got the default.cshtml for one and user custom.cshtml for another?
Figured this out - use this instead of the html helper! Sorted.
This is also useful for nesting Blocklists within blocklists. Cheers
is working on a reply...