Please spot my mistake

67 views
Skip to first unread message

Joost

unread,
Feb 18, 2020, 2:52:20 PM2/18/20
to TiddlyWiki

Thanks for reading.

I am currently playing around with the nice "Shiraz plugin" and somewhere I make mistake, but I can't find it.

In this example I have:

tittler "Project A" with tag "project"
tittler "Project B with tag "project"
tittler "Project C" with tag "project"

And something to select:

<$select tiddler="$:/temp/selectproject" default=''>
<$list filter="[tag[project]]">
<option value=<<currentTiddler>>><<currentTiddler>></option>
</$list>
</$select>

{{$:/temp/selectproject!!text}} gives output: "Project A"
 
The following shows my table with "Project A" because there is a task with a project field "Project A"

<$macrocall $name=table-dynamic filter="[tag[task]project[Project A]!tag[done]]" fields="tbl-checkbox tbl-expand tbl-delete title project priority status assignee created due-date" class="w-100 table-hover thead-primary" stateTiddler="tasking" caption="''Task overview''" />

I expected the following would also show the same table (with Project A still selected):

<$macrocall $name=table-dynamic filter="[tag[task]project[$:/temp/selectproject!!text]!tag[done]]" fields="tbl-checkbox tbl-expand tbl-delete title project priority status assignee created due-date" class="w-100 table-hover thead-primary" stateTiddler="tasking" caption="''Task overview''" />

But instead I got "filter input is empty"

I assume there is a mistake in: [tag[task]project[$:/temp/selectproject!!text]!tag[done]]

A clue or help is appreciated ;-) Thanks in advance!


Mark S.

unread,
Feb 18, 2020, 3:25:46 PM2/18/20
to TiddlyWiki


On Tuesday, February 18, 2020 at 11:52:20 AM UTC-8, Joost wrote:


I assume there is a mistake in: [tag[task]project[$:/temp/selectproject!!text]!tag[done]]



[tag[task]project{$:/temp/selectproject!!text}!tag[done]]

Eric Shulman

unread,
Feb 18, 2020, 3:30:06 PM2/18/20
to TiddlyWiki
On Tuesday, February 18, 2020 at 11:52:20 AM UTC-8, Joost wrote:
{{$:/temp/selectproject!!text}} gives output: "Project A"
I expected the following would also show the same table (with Project A still selected):
<$macrocall $name=table-dynamic filter="[tag[task]project[$:/temp/selectproject!!text]!tag[done]]" fields="tbl-checkbox tbl-expand tbl-delete title project priority status assignee created due-date" class="w-100 table-hover thead-primary" stateTiddler="tasking" caption="''Task overview''" />
But instead I got "filter input is empty"

To get a filter parameter from tiddler contents, use curly braces, not square brackets.  Thus:

filter="[tag[task]project{$:/temp/selectproject!!text}!tag[done]]" 

In filter syntax, the brackets used for a filter parameter indicate the type of parameter being provided:
* square brackets are for *literal* values
* curly braces are for tiddler *references*
* angle brackets are for *variables*

note: while inline wiki content uses *doubled* brackets (i.e., [[TiddlerName]] for links, {{TiddlerName!!text}} for transclusion, and <<variableName>> to render a variable or macro), filter syntax does not use *doubled* bracketing

enjoy,
-e

Joost

unread,
Feb 18, 2020, 3:30:23 PM2/18/20
to TiddlyWiki


Op dinsdag 18 februari 2020 21:25:46 UTC+1 schreef Mark S.:
Major thanks! That works. I thought I tried that, but sometimes you get bit blinded trying ;-)
Reply all
Reply to author
Forward
0 new messages