Skip to content

Theme blocks optimisations #882

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

Open
1 task done
stijns96 opened this issue Apr 9, 2025 · 4 comments
Open
1 task done

Theme blocks optimisations #882

stijns96 opened this issue Apr 9, 2025 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@stijns96
Copy link
Contributor

stijns96 commented Apr 9, 2025

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

  • 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.

@jamesmengo jamesmengo added the enhancement New feature or request label Apr 11, 2025
@jamesmengo jamesmengo self-assigned this Apr 11, 2025
@jamesmengo
Copy link
Contributor

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 :)

@stijns96
Copy link
Contributor Author

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 🙂

@mdamjanic7
Copy link

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 mdamjanic7 assigned mdamjanic7 and unassigned jamesmengo Apr 15, 2025
@stijns96
Copy link
Contributor Author

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants