Support

Account

Home Forums Gutenberg Show repeater-example in Gutenberg block

Unread

Show repeater-example in Gutenberg block

  • Hello,

    I am using the block.json to define my ACF Gutenberg blocks. Currently I am making a slideshow-block. I made an ACF slideshow field group that contains a repeater field with a WYSIWYG-text field (title) and image field (image).

    My block.json has the following code:

    {
      "name": "acf/slideshow",
      "title": "Slideshow",
      "description": "Show one or more images with text.",
      "style": [
        "file:./slideshow.css"
      ],
      "category": "media",
      "icon": "align-center",
      "keywords": [
        "slideshow"
      ],
      "acf": {
        "mode": "auto",
        "renderTemplate": "slideshow.php"
      },
      "example": {
        "attributes": {
          "data": {
            "slideshow": {
              "title": "This is an example text"
            },
          }
        }
      }
    }

    In the block editor when I want to select a block I will see an example of this block. I want the example to show the text: “This is an example text” (like defined in the block.json). But it only shows “T”, the first character of the string. What am I doing wrong?

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.