Part of #71517
What problem does this address?
When inserting any pattern with a category from the main inserter sidebar, the inserted block usually has a few metadata attributes set, for example here's a pattern from TT5:
{
"metadata": {
"categories":["about"],
"patternName":"twentytwentyfive/banner-cover-big-heading",
"name":"Cover with big heading"
}
}
As part of the contentOnly patterns experiment, there are a few places where patternName is added, but categories isn't added (or isn't added correctly). The consistency around how that works could be improved. Here's some examples:
- When using the "Create pattern" option on a block to convert it to an unsynced pattern (link)
- The slash inserter - the
categories attribute is added but the category values are ids and not slugs (link)
Similarly, another consideration is whether the categories attribtute should be removed when a pattern is detached:
- Edit contents button (link)
- Detach menu item (link)
One of the reasons this wasn't addressed originally is that it's not clear what categories is for, so it'd be good to discover that first. Also, sometimes the id is used and sometimes the slug (even for the same pattern and category inserted from different places), so that needs to be understood. @aaronrobertshaw dropped a couple of links to relevant issues in a previous conversation:
Part of #71517
What problem does this address?
When inserting any pattern with a category from the main inserter sidebar, the inserted block usually has a few metadata attributes set, for example here's a pattern from TT5:
As part of the
contentOnlypatterns experiment, there are a few places wherepatternNameis added, butcategoriesisn't added (or isn't added correctly). The consistency around how that works could be improved. Here's some examples:categoriesattribute is added but the category values are ids and not slugs (link)Similarly, another consideration is whether the
categoriesattribtute should be removed when a pattern is detached:One of the reasons this wasn't addressed originally is that it's not clear what
categoriesis for, so it'd be good to discover that first. Also, sometimes theidis used and sometimes theslug(even for the same pattern and category inserted from different places), so that needs to be understood. @aaronrobertshaw dropped a couple of links to relevant issues in a previous conversation: