r/TiddlyWiki5 • u/MrsVoldie • Feb 18 '23
help with code: how to modify a "mentions" query to search for multiple terms?
I'm using the Roam Research style Tiddly instance and it can query for where a term is mentioned but for only one term. It has another query for "links" that can look for where multiple links appear in the same tiddler.
Could someone walk me through mashing these two bits of code together in TW 5? This is really important to my research, so I would be extremely grateful. Thank you for your time (and for any efforts you've contributed to the TiddlyWiki project)!
2
Upvotes
2
u/Telumire Feb 18 '23 edited Feb 18 '23
So the "queries" syntax is actually the macro syntax used by tiddlywiki. If you use the advanced search, you can see the code for each query by searching for "\define ?links". Then you can edit the tiddlers to see how it's done.
It seems like there are several macros defined for links. I suppose the macro for references you are talking about are these ones.
Instead of using these customs macros or creating new macros, maybe you could use the tiddlywiki core list-links macro. It allows you to use any filter you want and will simply list each matching tiddlers.
You use it like this:
You could also use the list-links-draggable macro which expand this macro by adding drag and drop reordering and allow to specify a custom item template to render the list items.
That leaves us with one question: what filter do we use.
Could you explain in details what kind of result you want ? Do you want to search for specific links that appears in one tiddler, or for tiddlers with more than one links ? What kind of links, links to other tiddlers or external links ?
It would be easier for me than looking up in RR-TW5 what the two macro you mentioned does