Increase maximum blocks depth

I came up against the maximum blocks depth today, which is a bit annoying! I don’t feel like I’ve done anything excessively complex so it’s a shame to be limited here.

My modular block field has:

  • Block section which can contain various types of content block, which contains:
    • Block dast which is a structured text which allows embedded blocks, which contains:
      • Block grid which allows several blocks of:
        • Block card which has title, body, buttons which contains:
          • Block button which has button-text and link which is a block of:
            • Block link_internal, link_email or link_external ← cannot be inserted, as hits maximum block depth

The above all feels to me like legitimate use of modular blocks, as each level is a repeatable unit with its own fields and validation concerns.

Is there a technical reason for the current maximum block depth?

@convincible,

The default block depth is mostly there as a sanity check. It’s there mostly just because the UI and API shape can get pretty bad if you nest too deeply, and we don’t want customers accidentally doing that and ā€œfootgunningā€ themselves…

That said, this use case looks OK to me. If you know what you’re doing and just need a few more levels of nesting, please email us at support@datocms.com with the specific project ID and we can raise the block depth for you there (assuming it’s on a paid plan). There is no extra charge for this; it’s just something we manually adjust for people on an as-needed basis, and only after a manual review.

You might also want to consider (totally up to you though) simplifying that schema a little bit, e.g. using Better Links - Plugins — DatoCMS to store the links information in a single JSON block instead of nesting more deeply within it. (Or you can do both, depending on your needs.)

In any case, email us with the project details and we can raise the limit for you, within reason! Like 6-8 levels of nesting should be fine, maybe a bit higher… just not like dozens of levels deep :slight_smile:

OK thanks, I will email!