Different ways to structure data

There is another way to organize pages and it is my favourite so far because it scales well with very long complex “poly-hierarchies”:

You can write indexes like the following where you want:

- [[Index]]
  - [[Foo parent]]
    - [[ Foo child]]
  - [[Bar parent]]
    - [[Bar child]]

Then when you are on a page and you want to see where it is in one or more indexes, use

{{query (and <%current page%> [[Index]])}}

You will be able to browse the hierarchy without leaving the page.

You can create a macro with it and a custom command, so that you can just type /Index at the top of a page to add it.


P.S. you can use my minimal style for queries to make the indexes look more native:

5 Likes