[TW5] Question about the filter operator: list

216 views
Skip to first unread message

Alberto Molina

unread,
Jun 14, 2014, 6:25:11 PM6/14/14
to tiddl...@googlegroups.com
Hi,

If I write the following in a new tiddler on tiddlywiki.com

<$list filter="[[HelloThere]tags[]]">
{{!!list}}
</$list>

I get, as expected, the contents of the list field of the tiddlers which are used as tags of [[HelloThere]]. In this case, its the contents of the list field of the tiddler [[introduction]].

But if I write:

<$list filter="[[HelloThere]tags[]list[]]"/>

I do not get the same results. The above code shows the contents of the list field of [[HelloThere]] instead of [[introduction]]. Why?

Am I wrong expecting the same results or is there something wrong in the code?

Alberto


Jeremy Ruston

unread,
Jun 15, 2014, 3:47:24 AM6/15/14
to TiddlyWiki
Hi Alberto

The "list" filter operator replaces the current list with the content of the list field of its operand. See:


If the tiddler title is omitted from the operand then it defaults to the current tiddler.

Stephan has also pointed out that the semantics of the `list` operator are unexpected and not very useful. At this point I'd rather add improved filter operators and then deprecate 'list', rather than changing the existing implementation.

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 http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.



--
Jeremy Ruston
mailto:jeremy...@gmail.com

Alberto Molina

unread,
Jun 15, 2014, 5:26:05 PM6/15/14
to tiddl...@googlegroups.com
Thanks Jeremy!

I saw http://tiddlywiki.com/#FilterOperator%3A%20list but didn’t understood.

Alberto
Message has been deleted

Stephan Hradek

unread,
Jun 16, 2014, 12:52:20 AM6/16/14
to tiddl...@googlegroups.com
Let's try again. Last time my post appeared twice and when deleting one, both were gone.

This is what I understood from the descreption.

Imagin your current filter came to the point where it had these tiddler names:

A B C D E F G

Now you have in your current tiddler a field called "list" containing

E F G H I J

list[] -> E F G  I J

!list[] -> A B C D

if  you have in the tiddler "Z" a field "mylist" containing A C E G you will get this

list[Z!!mylist] -> A C E G

!list[Z!!mylist] -> B D F

Stephan Hradek

unread,
Jun 17, 2014, 2:06:02 AM6/17/14
to tiddl...@googlegroups.com, jeremy...@gmail.com
@Jeremy


Am Sonntag, 15. Juni 2014 09:47:24 UTC+2 schrieb Jeremy Ruston:
Hi Alberto

The "list" filter operator replaces the current list with the content of the list field of its operand. See:


 
I have the feeling, the consistency is lost here.

To my understanding
[list[HelloThere!!mylist]]

Should be

[list{HelloThere!!mylist}]

While

[list[something somethingelse athirdthing]]

Should be the fixed list of the 3 elements listed.

So your example should be interpreted as  a list with one element named "HelloThere!!mylist".



Jeremy Ruston

unread,
Jun 17, 2014, 3:17:04 AM6/17/14
to Stephan Hradek, TiddlyWiki
Hi Stephan

I have the feeling, the consistency is lost here.

The "list" operator was implemented back before the filter syntax allowed indirect operands.

As I said above, I agree that the `list` filter operator is broken. However we need to fix it by introducing a new filter operator, rather than breaking backwards compatibility of the existing operator.

Best wishes

Jeremy.


Danielo Rodríguez

unread,
Aug 29, 2014, 4:02:37 AM8/29/14
to tiddl...@googlegroups.com, stephan...@gmail.com, jeremy...@gmail.com
Hello,

I hope it is ok to write in and old topic, but I think the title fits perfectly.

I would like to write this:

<$list filter="[list[!!related]]"> <$link>{{!!title}}</$link></$list>

in an easier form like this:
{{{[list[!!related]]}}

What is the problem? In the second option all the links appears together. There is no space between them. And that's the only problem. What about a new filter operand, or something else, that specifies how results should be separated?

PMario

unread,
Aug 29, 2014, 6:44:18 AM8/29/14
to tiddl...@googlegroups.com, stephan...@gmail.com, jeremy...@gmail.com
On Friday, August 29, 2014 10:02:37 AM UTC+2, Danielo Rodríguez wrote:

in an easier form like this:
{{{[list[!!related]]}}

What is the problem? In the second option all the links appears together. There is no space between them. And that's the only problem. What about a new filter operand, or something else, that specifies how results should be separated?

imo you need to add a template
http://tiddlywiki.com/#Transclusion%20in%20WikiText

eg:
<ul>
{{{ [list[!!related]] || xview }}}
</ul>

xview

<li><$view field=title /></li>

The <ul> or <ol> tags are neded, to get a proper html structure for styling.
If you don't like to type much, create a macro that uses parameters for ol, ul, fieldname ....

have fun!
mario
Reply all
Reply to author
Forward
0 new messages