Show items tagged under a tag hierarchy

I think my question is best explained with an example:
Let’s say i write something about a math lesson i had. I might tag/link that block with #math.

Now i want #math to be a #class.

And a #class falls under something like #school.

When i search for the tag #school, I want to see everything tagged #school, but also all blocks tagged #class and #math as those are under the umbrella #school. Is there a inbuilt way to do this I just haven’t discovered yet? Or would this be better suited for a query – and if so how would such a query look without manually typing in each tag. (Or maybe my approach to all of this is completely wrong?)

Hi, first of all your poster is very confusing. You start with math then class then school then switch orders in the asking and is not clear what you’re trying to do.

Please structure questions and examples properly. It’s your best chance to get an answer.

Secondly, have you looked into hierarchy? It is true in pages and tags. So you’d go like “#tag1/tag2/tag3” wrote like that

tag 3 would show as a sub tag of tag2, and so on

When you need it you’d tag it with the hierarchy in the tag

Reading again, your question it seems like you want to see everything that is under tag three, even when you click/are on tag2

I don’t think that’s possible as far as I know

You have tagged pages not tags. There is no hierarchy between the tags in your example.

In the DB version this can be done easily by extending tags, you should give it a try (you can test it without downloading it by going to test.logseq.com, and if you want to download it go to Release Desktop app Nightly Release 20260609 · logseq/logseq · GitHub). In your case, you would set the Extends property of ‘math’ to ‘class’ and then ‘class’ to ‘school’