Variable not recognised in filter with enlist operator

90 views
Skip to first unread message

David Nebauer

unread,
Mar 3, 2019, 7:28:55 AM3/3/19
to TiddlyWiki
The following displays the items from the myfield field in the MyTiddler tiddler:

<$list filter="[enlist{MyTiddler!!myfield}]" variable="field-item">

<<field-item>>

</$list>

This, which I expect to be exactly equivalent, displays nothing:

<$set name="datasource" value="MyTiddler">

<$list filter="[enlist{<datasource>!!myfield}]" variable="field-item">

<<field-item>>

</$list>

</$set>

As far as I can tell, using a variable in a filter like this is correct syntax, but it does not work in this case.

I'm flummoxed since there are plenty of examples online of similar uses of variables in filters which are said to work. Can anyone help me understand what is (not) happening here?

Regards,
David.

Jeremy Ruston

unread,
Mar 3, 2019, 7:41:08 AM3/3/19
to tiddl...@googlegroups.com
Hi David

In filters you can’t combine the effect of the [, { and < brackets. Instead you’d have to extract the field value as a separate operation.

Try this (I’ve changed the tiddler and field names so that it works on tiddlywiki.com):

<$set name="datasource" value="Commands">

<$set name="datasourcetext" value={{{ [<datasource>get[tags]] }}}>

<$list filter="[enlist<datasourcetext>]" variable="field-item">

<$text text=<<field-item>>/>

</$list>

</$set>

</$set>

Note that I also replaced <<field-item>> with <$text text=<<field-item>>/>. The former will wikify the value of the field, so, for example, if it contains double single quotes they’d be interpreted as starting bold text.

Best wishes

Jeremy.

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/ecaad611-a265-4980-9ac2-6696de2ebe65%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Nebauer

unread,
Mar 3, 2019, 9:08:43 AM3/3/19
to TiddlyWiki
Thanks, Jeremy, for providing that solution, and so quickly. It solved my problem.

I thought I looked through all the relevant TW documentation when I was troubleshooting, but I missed the bit about not being able to combine the effects of the [, { and < brackets in filters. For future reference, where is that documented?

Regards,
David.

Jeremy Ruston

unread,
Mar 3, 2019, 9:14:35 AM3/3/19
to tiddl...@googlegroups.com
The main introduction to filter notation doesn't explicitly say that nesting isn't allowed, but it may imply that it is allowed:


The most hardcore documentation on this is the filter syntax railroad diagrams:


Best wishes

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

David Nebauer

unread,
Mar 3, 2019, 9:29:31 AM3/3/19
to tiddl...@googlegroups.com
Hmm, I didn't read the intro to filter notation that way, but I guess it's what the Filter Parameter tiddler is saying.

Thanks again.

Regards,
David.

On Sun, 3 Mar 2019 at 23:44, Jeremy Ruston <jeremy...@gmail.com> wrote:
The main introduction to filter notation doesn't explicitly say that nesting isn't allowed, but it may imply that it is allowed:


The most hardcore documentation on this is the filter syntax railroad diagrams.

Jeremy Ruston

unread,
Mar 3, 2019, 9:34:45 AM3/3/19
to tiddl...@googlegroups.com
Hi David

I've added a clarifying note to the docs:


Best wishes

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

David Nebauer

unread,
Mar 3, 2019, 9:42:27 AM3/3/19
to tiddl...@googlegroups.com
That's great, Jeremy. It should help the next person who tries the same thing I did and gets desperate enough to look at the documentation!

Regards,
David.

On Mon, 4 Mar 2019 at 00:04, Jeremy Ruston <jeremy...@gmail.com> wrote:

I've added a clarifying note to the docs.

TonyM

unread,
Mar 3, 2019, 3:39:57 PM3/3/19
to TiddlyWiki
David,

I can recomend systematic review of the documentation at tiddlywiki.com there is a lot of features and easter eggs to be found. The documention nessasarily is structured in a particular way, as a result people do structure alternate documents and share them so a search with tiddlywiki as a key word can find resources of substantial value.

My own draft effort seen here may vary well have helped you. http://tiddlywiki.psat.com.au/#Variables%2C%20Parameters%20and%20transclusions

Best of luck
Tony

David Nebauer

unread,
Mar 3, 2019, 4:04:06 PM3/3/19
to tiddl...@googlegroups.com
Thanks, Tony, for your suggestion and the pointer to your own notes. I see your notes do state after an example of double curly braces in a filter that "no delimiters other than the curly braces; you can not 'concatenate' other values into the filter value here".

Regards,
David.

TonyM

unread,
Mar 3, 2019, 5:07:46 PM3/3/19
to TiddlyWiki
David,

The Section not only tries and explain it but provides methods.

Regards
Tony

TonyM

unread,
Mar 3, 2019, 5:08:19 PM3/3/19
to TiddlyWiki
Sorry,

The Section Concatenating values for use in Macros and Widgets not only tries and explain it but provides methods.

Tony
Reply all
Reply to author
Forward
0 new messages