theme-tools icon indicating copy to clipboard operation
theme-tools copied to clipboard

Theme blocks optimisations

Open stijns96 opened this issue 9 months ago • 4 comments

1. Not able to not render the theme block element when no blocks are added. I'd like to check e.g. {{ block.size }} or something like this to be able to ditch the render of the block (e.g. groups) to avoid dom rendering.

Image

2. Not able to limit the amount of blocks that can be added. Add support for something like "max_blocks" or "limit" to prevent to much blocks.

Image

Checklist

  • [x] I have checked and made sure that the proposal adheres to this plugin's principles

Additional context Theme blocks are super powerful and really pleasant to work with, but it would be even better if is could a bit more flexible.

stijns96 avatar Apr 09 '25 12:04 stijns96

Hey @stijns96!

I believe these changes you're suggesting to the theme platform itself.

I'm not sure that this is the best place to get the relevant eyes on this suggestion, but I'm going to assign this to myself and keep this issue open so that I can make sure to follow up next week to figure out where the best place to raise these issues is.

This is a great suggestion! Thanks :)

jamesmengo avatar Apr 11 '25 22:04 jamesmengo

Hi @jamesmengo ,

Thanks!

It happens quite some time that I'm not 100% sure where to open these kind of issues...

Luckely you guys are helpfull and a follow up would be much appreciated 🙂

stijns96 avatar Apr 12 '25 05:04 stijns96

Hey @stijns96 👋 For the first issue, {{ section.blocks.size }} is likely what you are looking for. For the second one, can you provide a bit more context in terms of what you are trying to achieve? I'm trying to understand if it is similar to the request we have here.

mdamjanic7 avatar Apr 15 '25 01:04 mdamjanic7

Hi @mdamjanic7,

{{ section.blocks.size }} is only available on section level. I'm talking about nested private theme blocks.

For my second point you're mentioned the exact functionality that I want to use :)

stijns96 avatar Apr 15 '25 06:04 stijns96