Sorting or restricting a list filter by index

69 views
Skip to first unread message

Christian Macedo

unread,
Sep 9, 2019, 9:02:40 AM9/9/19
to tiddl...@googlegroups.com
I've got a set of data tiddlers each of which are structured as below

name:James Brown
team
:Android
location
:Norway
...

And a list filter that looks like this. 

<table>
  <th>NAME</th>
  <th>TEAM</th>
  <th>LOCATION</th>
  <$list filter='[tag[person]sort[team]]'>
    <tr>
      <td><$link to=<<currentTiddler>>><$view index='name'/></$link></td>
      <td>{{##team}}</td>
      <td>{{##location}}</td>
    </tr>
  </$list>
</table>

A table is produced with all the tiddlers that match the filter criteria. What I would like to do however is to modify the filter such that it shows a table row for for each tiddler whose team value is 'Android'.

btw, data tiddlers are my new favourite thing. Congrats to the whole team. Again!

Aidan Grey

unread,
Sep 9, 2019, 10:45:15 AM9/9/19
to tiddl...@googlegroups.com
Just change this

filter='[tag[person]sort[team]]'>

To this

filter='[tag[person]team[android]sort[team]]'>



On Mon, Sep 9, 2019, 7:02 AM Christian Macedo, <christi...@gmail.com> wrote:
I've got a set of data tiddlers each of which are structured as below

name:James Brown
team
:Android
location
:Norway
...

And a list filter that looks like this. 

<table>
  <th>NAME</th>
  <th>TEAM</th>
  <th>LOCATION</th>
  <$list filter='[tag[person]sort[team]]'>
    <tr>
      <td><$link to=<<currentTiddler>>><$view index='name'/></$link></td>
      <td>{{##team}}</td>
      <td>{{##location}}</td>
    </tr>
  </$list>
</table>

A table is produced with all the tiddlers that match the filter criteria. What I would like to do however is to modify the filter such that it shows a table row for for each tiddler whose team field is 'Android'.

btw, data tiddlers are my new favourite thing. Congrats to the whole team. Again!

--
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 tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/fcc58c9f-d71d-4e01-8351-4f11a5802394%40googlegroups.com.

Christian Macedo

unread,
Sep 9, 2019, 11:12:04 AM9/9/19
to TiddlyWiki
That doesn't seem to work. I just receive an empty list where I'm expecting quite a few rows. 

Does the list filter really accept a data index as a variable similar to `tag`?
To unsubscribe from this group and stop receiving emails from it, send an email to tiddl...@googlegroups.com.

Christian Macedo

unread,
Sep 9, 2019, 11:29:06 AM9/9/19
to tiddl...@googlegroups.com
This seems to have worked:

"""[tag[person]sort[team]search:text[location: Norway]]"""

Although this seems to be not quite beautiful. Are there any other suggestions?

Christian Macedo

unread,
Sep 9, 2019, 11:41:52 AM9/9/19
to TiddlyWiki

Mark S.

unread,
Sep 9, 2019, 11:52:35 AM9/9/19
to TiddlyWiki
By "data tiddlers", do you mean "data dictionary tiddlers" ?

If so, I don't think your "sort" here is actually doing anything. Sort only works on fields.

Data dictionaries are useful when you have long lists of information that don't benefit from the
overhead of a normal tiddler. Or when you have a lot of simple information you copy and paste
into a single tiddler. But if you have a data tiddler for each person, then there is no
benefit from the dictionary, and things like this will be more complicated, partially because
there is little core functionality for dictionaries.

If you're using regular tiddlers, then you're filter becomes

  <$list filter='[tag[person]field:team[Android]]'>

Note that it doesn't sort on team -- they'll all have same entry!

Mark

Christian Macedo

unread,
Sep 9, 2019, 12:02:30 PM9/9/19
to TiddlyWiki
Hi Mark, 

Yep it was data dictionary tiddler I meant. My mistake. 

By the looks of it, as you say, this won't be a working solution. And, I'll need to use the fields instead. The issue is that filling in fields is to my mind requires a little more effort. Unless of course there's some import mechanism. 

Either way, many thanks. I'll have a look at importing. 

Christian. 

Mark S.

unread,
Sep 9, 2019, 1:39:58 PM9/9/19
to TiddlyWiki
It depends on the form of your data to be imported. For instance, if it's a spreadsheet, there is the Exel importer edition.

Good luck!
Reply all
Reply to author
Forward
0 new messages