Skip to content

Block variation title not displayed in block sidebar #43835

Answered by t-hamano
florianbrinkmann asked this question in Q&A
Discussion options

You must be logged in to vote

I think it is due to the missing isActive property.
For your repository, the following code would work:

{
  "variations": [
    {
      "name": "one-variation",
      "title": "One variation",
      "attributes": {
        "isVariation": true
      },
      "isActive": ["isVariation"]
    }
  ],
}

The reference for variations includes the following statement:

It’s worth mentioning that setting the isActive property can be useful for cases you want to use information from the block variation, after a block’s creation. For example, this API is used in useBlockDisplayInformation hook to fetch and display proper information on places like the BlockCard or Breadcrumbs components.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@florianbrinkmann
Comment options

Answer selected by florianbrinkmann
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
[Type] Question Questions about the design or development of the editor.
2 participants
Converted from issue

This discussion was converted from issue #43830 on September 04, 2022 11:46.