Skip to content

Question: Is it possible to propagate settings to child elements? #208

Description

@creativesuspects

Which Umbraco.Community.BlockPreview version are you using?

1.13.8

Which Umbraco version are you using? For example: 10.4.0 - don't just write v10

13.12.1

Bug summary

This is NOT a bug report, but a question.

I have configured the following BlockGrid datatype:

Image

Here's a (collapsed) view of that grid in the content section:

Image

And a partial BlockPreview output:

Image

Only the blocks in the Layout group are allowed in root. These blocks don't use BlockPreview, only the child blocks (Hero, Content, Sidebar) use BlockPreview. Each layout block contains a different area configuration and a settings model to allow an editor to pick a background color for the entire layout block. Some content blocks within that layout block should vary based on the selected background color. In the Umbraco website I can just use ViewData to pass these layout block settings on to its child blocks. But this doesn't work in the backoffice, because each block is rendered separately by BlockPreview, right? Is there a way to propagate these layout block settings to its child blocks in BlockPreview?

This question goes for the areas as well. Is there a way to make a child block aware of the area its placed inside of? Again, on the frontend I can just use the ViewData, but that doesn't work in the backoffice.

Steps to reproduce

n/a

Expected result / actual result

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions