Your sites Log in Sign up Menu

How to omit some tags from all_tags?

I know I can show all blog tags with all_tags in the side area of my blog site.

Is there a way to omit some tags from this list? (The omitted tags I'd rather like to list as (manually added) page links - as broad categories.)


2 years ago, 5 replies   Improve this question

You could use some CSS to accomplish this, e.g.

{{#all_tags}}
<span class="tag-{{slug}}">...</span>
{{/all_tags}}

<style>
.tag-apple,
.tag-pear {display:none}
</style>

Would that work?

Answered 2 years ago · Improve this answer

Smart idea! I think this will work. - Will try it soon.

Answered 2 years ago · Improve this answer

The trick works well for hiding marked tags. Thanks heaps!

Can use a similar trick to do the oppsite as well? Only show the tags I mark in CSS?

I tried :

...
<span class="hide-always" class="show-tag-{{slug}}">
...

with the CSS:

.hide-always {display:none}

.show-tag-apple,
.show-tag-pear {display:block}

but it doesn't seem to be possible to "overwrite" the first class with the second...

Answered 2 years ago · Improve this answer

The double class attribute is likely causing a problem. Try this instead:

<span class="show {{slug}}">...</span>
.show {display:none}

.show.apple,
.show.pear {display:block}
Answered 2 years ago · Improve this answer

Cool. Will try this. Thanks.

Answered 2 years ago · Improve this answer