Problem/Motivation
Patterns definitions already have tags: https://git.drupalcode.org/project/ui_patterns/-/blob/8.x-1.x/src/Defini...
/**
* Getter.
*
* @return array
* Property value.
*/
public function getTags() {
return $this->definition['tags'];
}
/**
* Setter.
*
* @param array $tags
* Property value.
*
* @return $this
*/
public function setTags(array $tags) {
$this->definition['tags'] = $tags;
return $this;
}
Tags can be added like that:
alert:
label: "Alert"
description: "..."
tags:
- Foo
- Bar
- Lorem Ipsum
fields: {}
However, tags are not printed in the pattern library.
Proposed resolution
Most of the ui patterns users are overriding patterns-meta-information.html.twig
However, it is still useful to add tags under description in the template provided by u_patterns_library:
<p class="pattern-preview__description">{{ pattern.description }}</p>
{% if pattern.tags %}
<p class="pattern-preview__tags">{{ pattern.tags|join(', ') }}</p>
{% endif %}
Just a proposal/ Not tested.
Issue fork ui_patterns-3347891
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
pdureau commentedComment #4
pdureau commentedComment #5
grimreaperDone in UI Suite Bootstrap in #3349067: UI Patterns library: display pattern tags
Comment #6
grimreaperReview done.
1 remark
1 question
Comment #7
pdureau commentedDone in the same MR
Comment #9
grimreaperMerged. Cherry-picking on 2.0.x
Comment #11
grimreaper