Is wikitext in $list formatting broken?

132 views
Skip to first unread message

Derry Birse

unread,
Apr 15, 2015, 4:25:26 AM4/15/15
to tiddl...@googlegroups.com
I have been trying to implement the Contacts DB example from Stephan Hradek's TW5 Magic site (TW 5.0.7 beta) in TW 5.1.7 and have found that table formatting in lists appears to be broken. Am I wrong?

I created a tiddler in both versions with the following formatted list filter

<$list filter="[is[current]]">
|!Street |{{!!street}} |
</$list>

In version 5.0.7 I get the expected result:

In version 5.1.7 I get the following, where the table wikitext is ignored:

Any Ideas?

thanks in advance.

PMario

unread,
Apr 15, 2015, 4:46:52 AM4/15/15
to tiddl...@googlegroups.com
Try this:

<$list filter="[is[current]]">

|!Street |{{!!street}} |
</$list>


The difference is the extra linebreak, which switches the witext parser to block mode, so it can render the table.

I think your production list will be different so may be you may find the following info useful.

try:

<$list filter="[is[current]]">
<$transclude tiddler="template" mode=block/>
</$list>


Create a tiddler named: template

|!Street |<$view field=street/> |


see: http://tiddlywiki.com/#ViewWidget:ViewWidget%20TranscludeWidget

have fun!
mario

Derry Birse

unread,
Apr 15, 2015, 6:13:30 AM4/15/15
to tiddl...@googlegroups.com
Great thanks, what a difference a blank line makes.

Danielo Rodríguez

unread,
Apr 15, 2015, 1:20:11 PM4/15/15
to tiddl...@googlegroups.com
It can be frustrating but it's not only a TW problem but all markdown style syntax.

TJ Hoeft

unread,
May 7, 2015, 4:39:12 PM5/7/15
to tiddl...@googlegroups.com
All,
I built a similar table.  I did it in HTML, which looks as follows:

<table>
<tr><td>Title</td><td>Follow Up Date</td><td>Modified</td></tr>


<$list filter="[tag[future-plan]sort[modified]]">
<tr><td><$link to={{!!title}}><$view field="title"/></$link></td><td><$view field="follow-up-date"/></td><td><$view field="modified" format="date" template="DD mmm YYYY at 0hh:0mm"/></td></tr>
</$list>
</table>
 
Not beautiful, but it works for now.

My question is if the method described for making a template would allow "conditional formatting" on rows, cols and cells.  Specifically, I would like to color code the table entries by their relative age like a heat map so I can quickly see the set of the oldest entries.

Ideas?
TJ

Jed Carty

unread,
May 7, 2015, 6:16:07 PM5/7/15
to tiddl...@googlegroups.com
TJ,

The relative age part of that would be the difficult thing, I have some javascript macros that find time differences but I haven't had the time to really put them to use yet. They are here if you want to try them out or improve them. There are bugs so be aware of that.

You can do a sort of brute force formatting by using list or reveal widgets. To use a list you would use filters like '[is[current]modified[somedate]limit[1]]', there are some cases where even with the new tag parameter for the reveal widgets the list widget works better.


<table>
<tr><td>Title</td><td>Follow Up Date</td><td>Modified</td></tr>


<$list filter="[tag[future-plan]sort[modified]]">

<$reveal type=match state='!!modified' text=somedate>
@@.firstclass <tr><td><$link to={{!!title}}><$view field="title"/></$link></td><td><$view field="follow-up-date"/></td><td><$view field="modified" format="date" template="DD mmm YYYY at 0hh:0mm"/></td></tr>@@
</$reveal>

<$reveal type=match state='!!modified' text=someotherdate>
@@.secondclass <tr><td><$link to={{!!title}}><$view field="title"/></$link></td><td><$view field="follow-up-date"/></td><td><$view field="modified" format="date" template="DD mmm YYYY at 0hh:0mm"/></td></tr>@@
</$reveal>

</$list>
</table>

and add more reveal widgets inside the first one to add more dates. This probably isn't useful as it is, but if you modify the day-diff macro or make a week-diff macro than you could do use the number of days or weeks that have gone by with the reveal widget to define different colors. The way they are written now you would probably have to rewrite the entire macro, but hopefully the ones I have are enough of a start. Automating what you want to do is possible with a bit of effort.

TJ Hoeft

unread,
May 8, 2015, 11:58:05 AM5/8/15
to tiddl...@googlegroups.com
Hi Jed,
Thanks for the ideas!  I'm not strong in Javascript, but I will have a look.  I'll keep tinkering and post my results.
TJ
Reply all
Reply to author
Forward
0 new messages