Kirby 3.5 Layout & Blocks question

I have on the same page 2 layout fields, say “grid” and “masonry”, with each a number of blocks (e.g. image, text, heading), .
How do I go about when I need different markup for each layout?
More specifically each layout needs different markup, also for the blocks inside. (so the image inside grid has different html from the image inside masonry).
Any pointers?

Never mind, figured out that you can loop over snippets in the foreach ($column->blocks() as $block): loop. Admins feel free to close this issue.