[TW5] Faulty macro?

92 views
Skip to first unread message

Mat

unread,
Jun 2, 2015, 7:53:57 PM6/2/15
to tiddl...@googlegroups.com
What is wrong w the following and how should it be done?

The idea is a table, first col showing non-repeated creator names and second col listing all creations (tiddler titles) for the respective creator.

\define contributionslist(contributor)
<$list filter="[creator[$contributor$]]"/>
\end

<table>
<$list filter="[each[creator]]">
   
<tr>
     
<td>{{!!creator}}</td>
     
<td><<contributionslist {{!!creator}}>></td>
   
</tr>
</
$list>
</table>


(My actual use for it is here where a few other parameters, and problems, are included)

<:-)
TWaddle.tiddlyspot

Mat

unread,
Jun 4, 2015, 7:35:49 PM6/4/15
to tiddl...@googlegroups.com
Anybody?

What I find particularly confusing is that the defined macro seems to work in parts but not as a whole (when called from within the "table function" as detailed in my original post).

For instance, if I hard code a name into the filter like so:

\define contributionslist(contributor)
<$list filter="[creator[Foobar]]"/>
\end

...it works; I get the table from the main function and a listing of Foobar's contribution for each. 
AND this;

\define contributionslist(contributor)
name
:$contributor$!

<$list filter="[creator[$contributor$]]"/>
\end

also works, i.e shows
name:Foobar!

...so why doesn't $contributor$ work in the contributorslist list filter? My TW does contain tiddlers with filled creator:name fields.


<:-)

RichardWilliamSmith

unread,
Jun 4, 2015, 8:42:13 PM6/4/15
to tiddl...@googlegroups.com
Hi Mat,

Not a solution - but I thin this is the same issue discussed here: - 


I suspect there is a workaround but my thinking cap didn't contain it last time I tried to figure it out.

Regards,
Richard

RichardWilliamSmith

unread,
Jun 4, 2015, 10:29:40 PM6/4/15
to tiddl...@googlegroups.com
Hi Again Mat,

Now I'm confused - I tried it again and it worked.

\define contributionslist(contributor)
name: $contributor$

<$list filter="[creator[$contributor$]]"/>
\end
<<contributionslist Foobar>>



What are we/am I missing?

Regards,
Richard

Richard Smith

unread,
Jun 4, 2015, 11:47:21 PM6/4/15
to tiddl...@googlegroups.com
Hi again Mat,

I suspect this might be a version issue, and/or there may be abetter way to do it -  see this tiddler - http://tiddlywiki.com/#Filter%20Parameter

I think I need to refresh my understanding of the software in it's current state - I suspect it can do a few things I don't know about now.

Regards,
Richard

Mat

unread,
Jun 5, 2015, 1:49:57 AM6/5/15
to tiddl...@googlegroups.com
Richard - thanks for taking a look at this!
 
Now I'm confused - I tried it again and it worked.

Sorry, my latter examples still refer to the original question. I.e the macro cases are still called from within the "table" function.
I'm updating my second post to reflect this.

<:-)

Mat

unread,
Jun 5, 2015, 3:16:06 AM6/5/15
to tiddl...@googlegroups.com
Wohoo! I nailed the little b***!

This gives the correct result

\define contributionslist(contributor)
<$list filter="[creator{!!creator}]"/>
\end


<table>
<$list filter="[each[creator]!creator[]">

   
<tr>
     
<td>{{!!creator}}</td>
     
<td><<contributionslist {{!!creator}} >></td>
   
</tr>
</
$list>
</table>

...which actually makes it possible to cut out the whole macro, thus:

<table>
<$list filter="[each[creator]!creator[]">
   
<tr>
     
<td>{{!!creator}}</td>
     
<td><$list filter="[creator{!!creator}]"/></td>
   
</tr>
</$list>
</table>


Them syntaex iz trecky thaengs.


Thanks for your help Richard!


<:-)

Reply all
Reply to author
Forward
0 new messages