When visiting a page that represents a company or group, I would like to list the people that reference it.
The out of the box “Linked Mentions.md” will return all mentions, which will include the pages that are people.
However, I would like to refine that query in a new template that will only return the pages that are people (tags = “type_person”)
What am I a doing wrong?
{{#let @linkedMentions = {link where toPage = @page.name and page != @page.name and page.tags = "type_person" order by page}}}
{{#if @linkedMentions}}
# People
{{#each @linkedMentions}}
* [[{{ref}}]]
{{/each}}
{{/if}}
{{/let}}
page is this context is a string, it’s the name of the page. It’s not an object you can pull additional properties out of (like page.tags).
This is a classic case of something that would require a join, which is not something SilverBullet supports. Hypothetically you could attempt to do a page lookup for every link, where you would somehow look up every page up by name, and then look at the tags defined in there, but this would be very costly. That said, let me include a space script that allows you to do this:
Hi @zef , first of all thank you very much for this great software!
Are there any plans to support those kind of joins in the query and/or template language?
My use case would be to list all my tasks except those in pages that are tagged with checklist.
After few tries I gave up when I got something like this:
{{#let @checklistPages = {page where tags = "checklist" select name}}}
{{#each @tsk in {task where done = false where not page in @checklistPages}}}
- [{{@tsk.state}}] {{@tsk.name}} [[{{@tsk.ref}}]]
{{/each}}
{{/let}}
then I went here to look for guidance on how to do that.
I suppose I can just turn my checklist into simple bullet points and call it a day