Different texts combinations on layouts

I am working on a website which has a dynamic layout.

1/2, 1/2 (Text and image)
1/1 (image)

I am using layout but I have a question. Even though these are the layouts there are different kinds of texts.

Possible structure of a Product page:

Section
[1/2, 1/2] Text (name, materials, price) and image
Section
[1/1] (image)
Section
[1/2, 1/2] Text (description) and image
Section
[1/2, 1/2] Text (another description) and image

Here is my blueprint:

title: Product
fields:
  layout:
    type: layout
    layouts:
      - "1/1"
      - "1/2, 1/2"
    fieldsets:
      - text
      - image

The problem is that not all the texts are the same.
In the top block the text should contain different fields for basic information about the product: name, materials, price… While on the 3rd block the text contains a description.

I wonder if it is possible to fields on the text block to identify the values with keys so I can request the name of one of the products in another page for example.

Can I create multiple text field combinations?
One which contains all the information (name, materials, price) and another one which only contains one field (description).

You can create custom block types for this purpose

Our guide provides an overview with links to further documentation

1 Like

Thank you! It was super helpful!

Is there a way to also limit the times I can use a custom block?

For example, the one that contains “name”, “materials” and “price” i would like it to be only one per page so that there are no conflicts having two prices per product.

Can I avoid a custom block to be used more than once in the same product/page?

No, that’s not possible. What you could do though is throw an error message from a page.update:before hook when there are more blocks than supposed to be. But maybe some help text in the block itself (“Use this block only once per page”) would be useful as well.

I marked as solved because the original question was answered and it worked but I have a question regarding your last comment.

If I can not limit the use of these blocks to only one use, can I at least every time they are used be filled with the same information?

eg. the block that contains the “name, materials, price” of the product was filled up before on the same page, if I create another instance of this block later in the same page, could it be filled up with the same information and if I edit, both would be edited? I don’t know if I am explaining properly. Establishing some kind of communication between the different instances of the same block, maybe using stores?

Why would you want to make it this complicated? I’d simply filter out all duplicated block types in the front-end.

I wanted to avoid the person editing from add multiple instances of the same block with different information. In the layout the same information appears at least two times per page in different layouts.