A tag list is a list of tags used to indicate that certain content is related to certain subjects by using a specific keywords, and where each subject is represented as a tag using the corresponding keyword.
A tag list allows to quickly scan on overviews which pieces of content are or aren’t related to certain subjects. It also allows to generate specific overviews with all content about a selection of certain subjects. On detail pages, a tag list shows what subject the page is about.
There are three types of tag lists, depending of the type of tags that is used, each with a unique use and presentation:
See the tags documentation for more information about the three types of tags and their usage in the style guide.
<div class="tag-list-wrapper">
<ul class="tag-list{{ modifier ? ' ' ~ modifier : ''}}">
{% for tag in tags %}
<li>
{% include '@tag' with {
tag_text: tag.text,
type: tag.type
} %}
</li>
{% endfor %}
{% if link %}
<li>
{% include '@link' with {
text: link.text,
link: link.link
} %}
</li>
{% endif %}
</ul>
</div>
<div class="tag-list-wrapper">
<ul class="tag-list">
<li>
<span class="tag ">
In the
</span>
</li>
<li>
<span class="tag ">
summer time
</span>
</li>
<li>
<span class="tag ">
when the weather
</span>
</li>
<li>
<span class="tag ">
is fine
</span>
</li>
</ul>
</div>
{
"modifier": null,
"tags": [
{
"text": "In the",
"type": "span-tag"
},
{
"text": "summer time",
"type": "span-tag"
},
{
"text": "when the weather",
"type": "span-tag"
},
{
"text": "is fine",
"type": "span-tag"
}
]
}
.tag-list-wrapper {
.tag-list {
display: flex;
flex-wrap: wrap;
margin: -.2rem;
list-style: none;
li {
margin: .2rem;
}
a {
@include bold-text;
white-space: nowrap;
}
}
}