0
votes

I am developing a custom section for a theme on Shopify. I used the Custom content template (custom-content.liquid) from the Debut theme as a starting point.

I need to have three fixed blocks in it - text, image, and text, in this particular order. I do not want to let people add or remove any of them, or rearrange them.

I played with the schema of my liquid file as well as read the documentation but I cannot find the way to do it. I found max_blocks, which does not work for me.

"presets": [
{
  "name": "Tripple banner",
  "category": "Advanced layout",
  "blocks": [
    {
      "type": "text"
    },
    {
      "type": "image"
    },
    {
      "type": "text"
    }
  ]
}

My text and image are simple blocks with a few settings in them.

An alternative is to create one section without blocks and move all my settings from the blocks I have to that one. It seems cumbersome to me. Is there a better way?

1
If you need text-image-text in that order, why not have all 3 as fields in a single block? (Or to use base-level settings instead of blocks in this instance?)Dave B
That was my assumption. Just thought there is an easy way to fix the number of elements in the schema.Miro J.

1 Answers

0
votes

The short answer is - not possible without a lot of code.

The way to go is to create a section in a liquid file, which has the three blocks fixed and their settings in the schema in the same file.