Odd <$vars behavior?

61 views
Skip to first unread message

stevesuny

unread,
Jul 28, 2017, 2:58:35 PM7/28/17
to TiddlyWiki
This is really weird:

This works, despite (because of?) the lack of a closing ">" on the first line:

<$vars field-name="design" 
<$list filter="[title<currentTiddler>!<field-name>[]]">
<div class="h2"><<field-name>>:</div>
<div class="text"><$transclude mode="block" field=<<field-name>>/></div>
</$list>
</$vars>


But this doesn't:

<$vars field-name="design">
<$list filter="[title<currentTiddler>!<field-name>[]]">
<div class="h2"><<field-name>>:</div>
<div class="text"><$transclude mode="block" field=<<field-name>>/></div>
</$list>
</$vars>

Thoughts?

//steve.

Mark S.

unread,
Jul 28, 2017, 3:46:10 PM7/28/17
to TiddlyWiki

It's angle bracket count is probably being thrown off by this:

<field-name>[]

Pretty sure that's not allowed. You will need a macro to stitch together your filter, like:

\define myfilter() [title<currentTiddler>!$(field-name)$[]]

<$vars field-name="design">
<$list filter=<<myfilter>>>

<div class="h2"><<field-name>>:</div>
<div class="text"><$transclude mode="block" field=<<field-name>>/></div>
</$list>
</
$vars>


Good luck!
Mark

Eric Shulman

unread,
Jul 28, 2017, 4:16:35 PM7/28/17
to TiddlyWiki
On Friday, July 28, 2017 at 12:46:10 PM UTC-7, Mark S. wrote:

It's angle bracket count is probably being thrown off by this:

<field-name>[]

Try using the FULL "field filter" syntax,  e.g., with the literal "field:" operator, followed by the <field-name> variable reference as a filter suffix, like this:

!field:<field-name>[]

references:

enjoy,
-e
Eric Shulman
TiddlyTools.com: "Small Tools for Big Ideas" (tm)
InsideTiddlyWiki: The Missing Manuals

stevesuny

unread,
Aug 2, 2017, 5:14:49 PM8/2/17
to TiddlyWiki
thanks, eric & mark; that worked. //steve.
Reply all
Reply to author
Forward
0 new messages