-
-
Notifications
You must be signed in to change notification settings - Fork 572
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
Block Groups vs IList<Block> #1238
Comments
Some use cases that this could be beneficial for:
|
When looking at the code, in GetRegionType that attempts to parse the example above, it's only looking for things that are an IEnumerable or have fields inside of it. Since BlockGroup only has an IList inside of it, it's neither and fails to be rendered. It would be ideal if this could render alike any other block, but I'm assuming there's more work than I'm anticipating to make that happen. |
Yes there’s a big difference in the data model between regions and blocks. Blocks are stored as a data type in the database, regions are just an id on the field table used for grouping the field data correctly when transforming the models. We have several issues open with features for regions that could much more easily be achieved with blocks, and block groups have many benefits over list regions, one obvious being that a block group can both have global fields on the group itself and items with values of there own. However, since it would require a completely different data model to store this information it would break backwards compability but it is something we could take into consideration for the new generic data model we’re looking at. /Håkan |
Similar to #952 |
Exactly! For a more technical in-depth answer, regions are saved using the following data-structure for Pages (slightly simplified).
The fields
Blocks were designed so they can be created without a Page or Post owning them (see #290) so they have their own entity. Also, a block group is in fact a block that has child blocks pointing to it with their Regions were just designed to be a grouping of fields on Pages & Posts. |
This unfortunately can not be implemented given the current data model. The main reasons for this is:
Changing the data model to support these features, the second we've looked at in the past, would unfortunately break all backwards compatibility and be very hard to migrate. |
I'm working on an example of a site with a classic/legacy "hero slider" that has shared content across the site.
I first created a HeroBlockGroup with HeroBlock,
If you try to extend the StandardSite in Mvc.Web with that as a region:
This doesn't pass the content type builder/resolution and the region is not displayed.
As a workaround, you can do
It seems so similar, is there any reason why BlockGroup doesn't/can't render as a region? It would be great to have block groups be able to be used as inline region definitions.
The text was updated successfully, but these errors were encountered: