Using the next operator and transcluding {{!!title}} in a filter

112 views
Skip to first unread message

stevesuny

unread,
Feb 18, 2016, 5:13:09 PM2/18/16
to TiddlyWiki
I am exploring the use of the next operator, and want to build "next" and "previous" buttons using tag lists etc.

Putting this code in the Tuesday tiddler http://tiddlywiki.com/#Tuesday
in Tiddlywiki.com the first line returns "Wednesday"  and the second, nothing.

1 <<list-links filter:"[[Tuesday]next[Days of the Week]]">>
2 <<list-links filter:"[[{{!!title}}]next[Days of the Week]]">>

I have trouble with syntax getting the {{!!title}} to work when embedded in code like this. What am I missing?

Thanks for any thoughts,

//steve



Eric Shulman

unread,
Feb 18, 2016, 5:36:38 PM2/18/16
to TiddlyWiki
You have too many brackets and braces... within filter syntax, there are three ways to specify a value, using brackets, chevrons and braces, like this: 

[Tuesday] is a constant literal text value
<variable> retrieves the value of a variable currently in scope
{TextReference} retrieves the value from a text reference 

Think of the brackets, chevrons and braces as different kinds of quotes that indicate how the enclosed content should be handled.  This is similar to the way wikitext syntax uses [[...]] for literal links, {{TextReference}} for transclusion, and <<macroname>> for variables/macros.  Note however that the filter syntax uses *single* brackets, chevrons, and braces, while the wikitext syntax uses *doubled* brackets, chevrons, and braces.

Thus, starting with your first example:
<<list-links filter:"[[Tuesday]next[Days of the Week]]">>

replace the [Tuesday] with {!!title} to use a TextReference to the title of the current tiddler:
<<list-links filter:"[{!!title}next[Days of the Week]]">>

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
InsideTiddlyWiki: The Missing Manuals

Hegart Dmishiv

unread,
Feb 19, 2016, 3:45:25 PM2/19/16
to tiddl...@googlegroups.com
Hi Eric,

I just tried using this as well, in my own {{DesignWrite}} exercise, and couldn't get it to work either, even following your example code above. I've used it on just this one tiddler so far, but I intend to use it in a ViewTemplate later. Here's my code:

<<list-links filter:"[{!!title}next[References]]">>

Any idea why this isn't working? That tiddler is tagged with  References , and there are two other tiddlers also tagged in the same collection / set. A standard <$list filter="[tag[References]"> filtered list sees them all.

Hegart.

Steven Schneider

unread,
Feb 19, 2016, 4:26:14 PM2/19/16
to TiddlyWiki

I suspect the problem Hegart is having here is the same as I just wrote the group about. We are trying to use the tag as the list. In Hegart's, <<list-links filter:"[list[References]]">> returns an empty list; he was hoping to move to the next tiddler in <<list-links filter:"[tag[References]]">>. So, how do we get that list into the next/previous filters?

//steve.

Steven Schneider

unread,
Feb 19, 2016, 4:27:12 PM2/19/16
to TiddlyWiki
Many thanks. It works...//steve.

Eric Shulman

unread,
Feb 19, 2016, 4:47:09 PM2/19/16
to TiddlyWiki
On Friday, February 19, 2016 at 1:26:14 PM UTC-8, Steven Schneider wrote:

I suspect the problem Hegart is having here is the same as I just wrote the group about. We are trying to use the tag as the list. In Hegart's, <<list-links filter:"[list[References]]">> returns an empty list; he was hoping to move to the next tiddler in <<list-links filter:"[tag[References]]">>. So, how do we get that list into the next/previous filters?
//steve.

As posted in reply on the other thread, use before[...] and after[...] rather than previous[...] and next[...] 

-e

Hegart Dmishiv

unread,
Feb 19, 2016, 4:48:18 PM2/19/16
to TiddlyWiki
Hi Steve,

Where's your "a tiddler is a tag is a tiddler" when you need it? ;-)

Hegart.
Reply all
Reply to author
Forward
0 new messages