Replies: 2 comments
-
|
@bakura10 we just ran into this exact situation, where we have statically rendered blocks, and we wanted to render either a thumbnail or some other markup in the child block based on a setting in the statically rendered block. So it might look like this: The issue is that if, in the statically rendered block, you do the following, The workaround we found is to use Shopify's splitting pattern and a forloop with modulo. So in the statically rendered block you would do something like this: Then in the nested block you would do something like this: It's pretty jank, but it works. It would be much better to have access to the |
Beta Was this translation helpful? Give feedback.
-
|
Also experienced this limitation, but in the reverse; wanted to access a theme block's Theme block: Section: In this example, So, yes, it would be great to be able to access theme block settings at the parent level, and parent settings within the theme block. Weirdly, noticed all theme block settings are shown in JSON in |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am reviewing some of the elements in our themes to figure out how to implement some things. Contrary to the sample implementation, I would prefer having a lot of focused components. Sometimes, it might be useful from an inner component to get access to the parent block.
For instance, we might imagine a "Icons group" block with some presentational settings, that could accept "Text with icon" block. How those inner block would render would depend of the parent setting.
I think many use cases could be achieved with a combination of CSS and container queries, but there might be trickier use case that would probably need that.
Beta Was this translation helpful? Give feedback.
All reactions