How to iterate over specific documents in a template?

Right after writing my own note-taking application I discovered Obsidian, had a look at the details, and archived my GitHub repo to switch to this wonderful product :upside_down_face:

After some time trying the basic features, I would like to go deeper in the templating - I am looking for “bootstrap advice” (some pointer to the right direction to get me started).

Specifically, I would like to build table of content pages where I would link to pages having specific tags (and other conditions), something along the lines of this pseudo-code:

for page in obsidian.allPages:
  if "hello" is in page.tags:
    {{ <li>{page.title|page.filename}</li> }}

(= create bullet points called after the title of the pages containing the tag hello and link them to the filename of the page)

I would like this to be a dynamic page - so that when I open it the content is updated with the current relevant pages in the vault.

What is the general direction I should take for that? (coding is OK, maybe even better than some complex non-code solutions - but anything will be wondeful anyway)

Did you try the dataview plugin?


I literally just discovered it a few minutes ago. It seems really powerful, thank you.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.