No transcluding system tiddlers???

95 views
Skip to first unread message

David Gifford

unread,
Jan 25, 2020, 8:13:28 AM1/25/20
to TiddlyWiki
Hi all

For some reason when I put either of the two snippets below into a tiddler tagged $:/tags/ViewTemplate, the results don't show when I have a backlink to a non-system tiddler from a system tiddler. What might I be doing wrong? Do system tiddlers not transclude to regular tiddlers?

`<$list filter="[all[current]is[system]backlinks[]sort[title]]"><span class="indent1"><$transclude field="text" mode="block"/><$link >---</$link></span></$list>`

`<$list filter="[is[system]all[current]backlinks[]sort[title]]"><span class="indent1"><$transclude field="text" mode="block"/><$link >---</$link></span></$list>`

Mat

unread,
Jan 25, 2020, 10:14:09 AM1/25/20
to TiddlyWiki
It is a conditional filter so, just to make sure: Is the current tiddler, where you expect results to be seen, a system tiddler (which is what your filter conditions)? In other words, is your tiddler where you have this construct titled with prefix $:/ ?

<:-)

David Gifford

unread,
Jan 25, 2020, 10:17:43 AM1/25/20
to TiddlyWiki
I have it set up this way:

The list filter is in a tiddler tagged viewtemplate which will then show under all regular tiddlers. So I want all system tiddlers backlinking to the current regular tiddler to be transcluded via the viewtemplate tiddler.

Mat

unread,
Jan 25, 2020, 12:50:34 PM1/25/20
to TiddlyWiki
As I understand it, you have this code snip in all tiddlers, true, because it has that tag. BUT only those tiddlers that fulfill the condition will actually show something and the condition is that the (current) tiddler is a system tiddler, i.e that it has the title prefix "$:/". If you're looking at a tiddler that is not a system tiddler, then the viewtemplate will not show anything because the condition is not fulfilled. If it IS a system tiddler, it might show something.

Maybe what you want is:

`<$list filter="[all[current]backlinks[]] +[prefix[$:/]sort[title]]"><span class="indent1"><$transclude field="text" mode="block"/><$link >---</$link></span></$list>`

I didn't try this by I think this should first get all backlinks to the current tid and then add the condition that it should be a system tid and then sort.

<:-)

David Gifford

unread,
Jan 25, 2020, 12:52:46 PM1/25/20
to TiddlyWiki
Only a minute or two ago I found my solution

<$list filter="[!is[system]regexp:text{!!title}sort[title]] [is[system]regexp:text{!!title}sort[title]] -[is[current]] -[[$:/HistoryList]]"><strong><$view field="title"/></strong><span class="indent1"><$link><span class="graybox"><$transclude field="text" mode="block" /></span></$link></span></$list>

Mat

unread,
Jan 25, 2020, 1:09:59 PM1/25/20
to TiddlyWiki
Great if you solved it - but note that you'll get false positives with this. For example, the tiddler "Hum" will appear to be mentioned in the text "Humpty dumpty". I don't recall the exact expression for making a regexp only accept exact titles but I know it's possible. 

Overall, note that the regexp will look to match strings whereas the backlinks filter will (I assume) look for actual links.

<:-)

David Gifford

unread,
Jan 25, 2020, 1:14:14 PM1/25/20
to TiddlyWiki
Yeah, I was wondering how to avoid getting false positives. Hopefully some kind soul will share his or her wisdom on that!

Mark S.

unread,
Jan 25, 2020, 1:44:27 PM1/25/20
to TiddlyWiki
You'll need a macro to wrap your criteria. I'm sure TT will be able to tweak the reg expression, but this seems to work:

\define mycrit() \b$(currentTiddler)$\b
<$list filter="[!is[system]regexp:text<mycrit>sort[title]] [is[system]regexp:text<mycrit>sort[title]] -[is[current]] -[[$:/HistoryList]]"><strong><$view field="title"/></strong><span class="indent1"><$link><span class="graybox"><$transclude field="text" mode="block" /></span></$link></span></$list>
- show quoted text -


Mark S.

unread,
Jan 25, 2020, 1:46:58 PM1/25/20
to TiddlyWiki
Also, I think that you can just use "all[tiddlers]".

\define mycrit() \b$(currentTiddler)$\b
<$list filter="[all[tiddlers]regexp:text<mycrit>sort[title]] -[is[current]] -[[$:/HistoryList]]"><strong><$view field="title"/></strong><span class="indent1"><$link><span class="graybox"><$transclude field="text" mode="block" /></span></$link></span></$list>

- show quoted text -

David Gifford

unread,
Jan 25, 2020, 1:53:17 PM1/25/20
to TiddlyWiki
Thank you, Mark!

David Gifford

unread,
Jan 25, 2020, 2:46:59 PM1/25/20
to TiddlyWiki
Will (?i) work somehow in your mycrit snippet, as it does in regular regexp? That is an important piece of the puzzle.


On Saturday, January 25, 2020 at 12:46:58 PM UTC-6, Mark S. wrote:

Mark S.

unread,
Jan 25, 2020, 4:19:16 PM1/25/20
to TiddlyWiki
Change the macro to this:

\define mycrit() (?i)\b$(currentTiddler)$\b
Reply all
Reply to author
Forward
0 new messages