On Monday, August 1, 2016 at 1:37:20 AM UTC-7, Dmitry Skopa wrote:
>
> <$list filter="[all[current]]">
> <h1>Related:</h1>
> <ul>
> <$list filter="[all[current]tagging[]sort[modified]]">
> <li>
> <$link to={{!!title}}><$view field="title"/></$link>
> </li>
> </$list>
> </ul>
> </$list>
>
> This works the way I want except one thing: I would like to remove
> "Related:" header when the list is empty. Is it possible?
>
Instead of writing just:
<h1>Related:</h1>
you can enclose it in a <$list> widget like this:
<$list filter="[all[current]tagging[]sort[modified]limit[1]]">
<h1>Related:</h1>
</$list>
This <$list> widget uses the same filter syntax as the <$list> widget that
actually produces the link output, but with the added "limit[1]". This
effectively turns the widget into a test that says "if the filter results
are not empty, show the heading". Note: you can optimize this filter a bit
more by leaving out the "sort[modified]" syntax, since it doesn't affect
the test conditions.
enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
InsideTiddlyWiki: The Missing Manuals
--
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 [email protected].
To post to this group, send email to [email protected].
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/571e6086-273f-452a-8e09-a2bda78a3a7d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.