Page that show blocks with specific tag

Things I have tried

Use Dataview plugin.

What I’m trying to do

In my daily notes I want to tag some sections for example:

#sport #running I was running for 20 minutes

And to have a page called “running” with all sections tagged #running.

In dataview I could do it with
running:: I was running for 20 mintues

but I couldn’t use two “tags” on some sections.

Is it possible to achieve this with some plugins?

You don’t need any plugins to do this. Obsidian has a built-in query feature that can search blocks of text for things like multiple tags. For example:

```query
block:(#sport #running)
```

This says: “Show me every paragraph of text in my vault that has both the #sport and the #running tags in it.”

You can read more about the search features in the help docs.

Here’s an example:

Thanks, @Craig. I didn’t know about embedding queries. It almost solves it for me but it would be nice if there were an option to expand search results. I see there is a feature request for it.

This plugin will be useful for u. Need to install manually or via BRAT (search “brat” in community plugins)

Thanks @efemkay, I will try it. I hope it is compatible with 1.0. It was not updated since July 7.

I can suggest a solution with dataview. But that implies a different way to write your “metadata”.

An example with bullet point lists.

# NoteA

Lorem ipsum dolor sit amet, consectetur adipiscing elit. 

- #sport #running I was running for 20 minutes
- #sport #gymn chess-press 10x

Praesent sit amet magna vel lacus condimentum finibus id ac quam. 
# NoteB
Interdum et malesuada fames ac ante ipsum primis in faucibus. 

- #sport #running I was running for 30 minutes

Sed erat nulla, scelerisque at consectetur vel, lobortis quis mauris. 

- #running A long run 

Now the query to collect all strings with the tag #running:

TABLE WITHOUT ID
	file.link AS "Day",
	regexreplace(Lists.text, "(#\S+)+", "") AS "Runing"
FROM #running
FLATTEN file.lists AS Lists
WHERE contains(Lists.tags, "#running")

Or a query to collect all strings with the tag #sport and identify the type of sport:

TABLE WITHOUT ID
	file.link AS "Day",
	filter(Lists.tags, (t) => t != "#sport") AS "Sport",
	regexreplace(Lists.text, "(#\S+)+", "") AS "Exercise"
FROM #sport
FLATTEN file.lists AS Lists
WHERE contains(Lists.tags, "#sport")

1 Like

Thanks @mnvwvnm.Your solution works well. The only downside is that I cannot put details inside subpoints. I maybe will try to do something like:

- #sport running 6 miles
  - #time 60 minutes 

I think Notion would allow me to achieve what I want more easily with the database but I only saw a demo so I’m not sure.