List of tiddlers in field

94 views
Skip to first unread message

Sebastián Ortega

unread,
Apr 4, 2021, 12:07:38 PM4/4/21
to TiddlyWiki
Hello,

I'm trying to organize a tiddlywiki in which I have a series of authors by using fields instead of just tags for everything and I have some problems.

I'm adding this to the view template with the intention of displaying author nationality and the fields he or she contributes:

<$list filter="[all[current]tag[Author]]">
  <span class="icon">{{$:/core/images/globe}}</span>
  <$macrocall $name="tag" tag={{!!nationality}}/> |
  <span class="icon">{{$:/core/images/info-button}}</span>
  <$list filter="[all[current]get[fields]]">
    <$macrocall $name="tag" tag=<<currentTiddler>>/>
  </$list>
</$list>

However, this doesn't create a separate tag pill per field but a single one with both fields concatenated. Here I was expecting one pill for Economics and another for Investing:

shot.jpg
I know it's due to the filter I'm using but I can't manage to find the right one by myself.

Do you know how to do this?

Eric Shulman

unread,
Apr 4, 2021, 12:56:08 PM4/4/21
to TiddlyWiki
On Sunday, April 4, 2021 at 9:07:38 AM UTC-7 mehequeda...@gmail.com wrote:
  <$list filter="[all[current]get[fields]]">
    <$macrocall $name="tag" tag=<<currentTiddler>>/>
  </$list>
</$list>

shot.jpg
I know it's due to the filter I'm using but I can't manage to find the right one by myself.

In your use-case, "fields" is the name of a single tiddler field that contains a space-separated *list* of fieldnames, and the get[fields] filter is just returning the entire value of that field as a single text string.  To get each entry from the "fields" list as a separate item, you can use the enlist operator, like this:

<$list filter="[all[current]enlist{!!fields}]">

enjoy,
-e

Sebastián Ortega

unread,
Apr 4, 2021, 4:30:44 PM4/4/21
to tiddl...@googlegroups.com
Many thanks Eric, it worked!

image.png

--
Sebastián


--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/18iq5Byg-Uc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/66f5a59f-8131-456b-bd7d-4eee05d2917cn%40googlegroups.com.

Sebastián Ortega

unread,
Apr 5, 2021, 4:54:34 AM4/5/21
to TiddlyWiki
There was another problem with my first snippet. Using the fields field works during the session but the data is not saved. I supposed it's because of a name clash with some reserved name. I've renamed it to "area".
Reply all
Reply to author
Forward
0 new messages