List Widget: Does it work correctly or NOT?

319 views
Skip to first unread message

Mohammad

unread,
Jun 28, 2018, 10:09:45 AM6/28/18
to tiddl...@googlegroups.com
Look at these examples

  • Example 1

<$list>
</$list>

Returns nothing!

  • Example 2

<$list>

</$list>

Returns all standard tiddlers (no system no shadow) every tiddler in a new line
  • Example 3

<$list></$list>

Returns  all tiddlers one after another with no line break!

  • Example 4

<$list filter="" >

</$list>

Returns nothing!


  • Example 5 (edited)

<$list filter=<<NotExistedMacro>> >

</$list>

Returns all tiddlers no shadow no system tiddlers!

How does list widget work?


Diego Mesa

unread,
Jun 28, 2018, 10:15:41 AM6/28/18
to TiddlyWiki
Beautifully illustrated Mohammad!

On Thursday, June 28, 2018 at 9:09:45 AM UTC-5, Mohammad wrote:
Look at these examples

  • Example 1

<$list>
</$list>

Returns nothing!

  • Example 2

<$list>

</$list>

Returns all standard tiddlers (no system no shadow) every tiddler in a new line
  • Example 3

<$list></$list>

Returns  all tiddlers one after another with no line break!

  • Example 4

<$list filter="" >

</$list>

Returns nothing!


  • Example 5

<$list filter="NotExistedMacro" >

</$list>

Returns all tiddlers no shadow no system tiddlers!

Mark S.

unread,
Jun 28, 2018, 10:39:07 AM6/28/18
to TiddlyWiki
Re #5, I just get a link to the single, non-existent tiddler.


 

On Thursday, June 28, 2018 at 7:09:45 AM UTC-7, Mohammad wrote:
Look at these examples

  • Example 1

<$list>
</$list>

Returns nothing!

  • Example 2

<$list>

</$list>

Returns all standard tiddlers (no system no shadow) every tiddler in a new line
  • Example 3

<$list></$list>

Returns  all tiddlers one after another with no line break!

  • Example 4

<$list filter="" >

</$list>

Returns nothing!


  • Example 5

<$list filter="NotExistedMacro" >

</$list>

Returns all tiddlers no shadow no system tiddlers!

Mohammad

unread,
Jun 28, 2018, 10:59:52 AM6/28/18
to tiddl...@googlegroups.com
Mark,
 It was my mistake! Look at the edited one!

<$list filter=<<NotExistedMacro>> >

</$list>

/Mohammad

Jeremy Ruston

unread,
Jun 28, 2018, 11:18:10 AM6/28/18
to tiddl...@googlegroups.com
Hi Mohammad

Some points about the list widget:

* If the “filter” attribute is not present then a default of “[!is[system]sort[title]]” is used
* If the list widget is completely empty (ie only whitespace between the opening and closing tags), then it behaves as if the content were a DIV or a SPAN containing a link to the current tiddler (it’s a DIV if the list widget is in block mode, or a SPAN if it is in inline mode)
* If the “template” attribute is not present then the content of the list widget will be used as the template, unless the widget is completely empty in which case a default template is used
 
It’s is itself more complex than we’d like, and interacts with some other complex concepts (eg inline vs. block) and has some weird edge cases, and bugs.

A useful tool for exploring this stuff is to use the “Internals” plugin to view the parse tree for each example.


<$list>
</$list>

Returns nothing!

This one is a bug, I think. The parser is seeing it as a widget/element containing a paragraph containing a new line, where it should be parsed the same as the next example.


<$list>

</$list>

Returns all standard tiddlers (no system no shadow) every tiddler in a new line

The blank content of the list widget is here correctly interpreted as the absence of a template, so the default template is used as described above

<$list></$list>

Returns  all tiddlers one after another with no line break!

This is the same as the previous example except the lack of a line break after the opening tag has triggered inline mode.

  • Example 4

<$list filter="" >

</$list>

Returns nothing!

That’s because an empty filter returns no tiddlers.
  • Example 4


<$list filter=<<NotExistedMacro>> >

</$list>
Returns all tiddlers no shadow no system tiddlers!

The missing macro makes the attribute act as if it were not present, and so you’re getting the default filter again.

Best wishes

Jeremy.



How does list widget work?



--
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/0c50e62f-ab99-4e33-9896-b296654ea825%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mohammad

unread,
Jun 28, 2018, 11:33:57 AM6/28/18
to TiddlyWiki
Hi Jeremy!

Thank you for your clarification!
I hope people come and help to develop a full covered documentation for Tiddlywiki.
I was writing a short code to step-through a nested list and I encountered this issue. I had misspelled the name of macro in example 5 and I got strange results.

Once again thank you for all your efforts.

/Mohammad

David Gifford

unread,
Jun 28, 2018, 11:46:55 AM6/28/18
to TiddlyWiki
Thanks for this helpful explanation, Jeremy. I made a link to your post in the toolmap under the Lists category.
Reply all
Reply to author
Forward
0 new messages