按标签组排序标签

Hi,

How can multiple tags in a topic be ordered? I have two tag groups: “Verified” and “Other Tags”. Can I order them from verified to other in topics?

image

I’d like it to be ordered like the 2nd topic in the picture. Right now tags are ordered by the order the user selects them when creating a topic.

It’s not possible because we don’t add any classes or attributes to designate which tag-group a tag belongs to.

We already have data-tag-name='example-tag'… it might also be useful to have data-tag-group='example-group'if a tag is in a group (I’m not sure how difficult that change would be though). Then you’d be able to target tag groups with CSS.

@awesomerobot

使用 CSS 按标签名定位时,实现该效果的最佳方式是什么?

我们曾使用简单的 float: left,但这会导致被推开的标签对齐错乱,并且需要在不同位置进行繁琐的像素调整才能实现对齐。

我能够按如下方式调整特定标签的显示顺序,使它们优先出现:

.discourse-tags .discourse-tag[data-tag-name=yourtag] {
    order: -1;
}