-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace Nested Content with Block List #64
Comments
@rasmusjp do you know about this? 😊 |
We currently don't ship with any models for the block list but you can add one your self. It could look something like this: public class BlockListItem
{
public Element Content { get; set; }
public Element? Settings { get; set; }
} and then use it like this public class MyModel : Content
{
public IEnumerable<BlockListItem> MyBlocks { get; set; }
} If your custom model inherits from |
Hi @rasmusjp Thanks for your help - it works! 🥳🎉 I think it would be great it the .NET Client shipped with
a
and then a
finally I have this in the product page razor view:
|
Issue description
In the code samples Nested Content is used and delivered as
IEnumerable<IElement>
:Umbraco.Headless.Client.Net/samples/Umbraco.Headless.Client.Samples.Web/Umbraco.Headless.Client.Samples.Web/Models/Frontpage.cs
Line 16 in f7e3c17
However I can't find any examples how to get content from Block List property and how to loop the blocks or just select content as
IEnumerable<IElement>
.. and then in razor view or controller cast a specific block type?Since Nested Content is deprecated and will be removed in an upcoming release or Umbraco (and probably in Heartcore as well), I think it should be practise as use Block List instead.
Based on the roadmap it seems Block Grid soon is supported as well:
https://umbraco.com/products/knowledge-center/roadmap/
The text was updated successfully, but these errors were encountered: