Populating the list field of a tiddler that is a tag

185 views
Skip to first unread message

Steven Schneider

unread,
Mar 23, 2018, 10:47:19 AM3/23/18
to TiddlyWiki
Hi,

I wrote this code the other day, and it got me thinking about different ways to use the tag field wondering how useful it might be to others. The challenge was to populate a list field, to give access to certain filters that use list. So what it does is basically creates a list field in a tiddler that consists of all tiddlers tagged with a specified tag. Probably not that earth shattering.

<$vars thisTiddler="IllustrationsPlay" thisTag="Illustrations">

List of <<thisTiddler>><br>
<$view field="list" tiddler=<<thisTiddler>>/><hr>

<$button>
Add all tiddlers tagged ''<<thisTag>>'' to the list field of the tiddler <<thisTiddler>>
<$action-listops $tiddler=<<thisTiddler>> $field="list" $filter="[tag<thisTag>]"/>
</$button>
</$vars>

I wanted to help a student generate a way to present, in order, a set of tiddlers, and the student had used tags to identify the tiddlers of interest. It seemed that he would have been better off with a list field, but I couldn't quite articulate why, so I wrote this script.

Perhaps someone might have a better explanation of the differences / advantages of using tags vs. list fields? I find myself a bit confused on this point. Thanks!

//steve.

Stephan Hradek

unread,
Mar 23, 2018, 12:25:06 PM3/23/18
to TiddlyWiki
To me it's absolutely unclear

a) What you're trying to achieve
b) What's your question

Really sorry for that. Do you think there are filters the student can't use becaue he used tags and he could have used, had he used lists? So can you give an example? Maybe publish an example somewhere for us to have a look at?

Steven Schneider

unread,
Mar 23, 2018, 1:51:27 PM3/23/18
to TiddlyWiki
Hmm. Let me try again:

At http://tombofhorrors.tiddlyspot.com/#Illustrations:Illustrations%20Description the author uses <<tabs>> to present images tagged with "Illustrations". This is ok, but not super ideal.  
I suggested he create a new tiddler called "Show the Illustrations" that made use of a list of tiddlers so that they could be identified and sorted. The <<tag Illustrations>> was of limited value, so I suggested he might use the list field instead (We ultimately ended up developing a tag-based macro instead of using a list field...). 

While exploring list fields, it was annoying to manually populate a list field with every tagged tiddler, so we wrote that short one-time use button script that essentially put the contents of the <<tags>> field into a <<list>> field of a specified tiddler. (It was also a way to introduce the use of the ActionListOps widget)(on reflection, there was probably a faster way to copy the contents of the tag field of a tiddler into the list field of another tiddler, but I didn't think of that until now).

Our discussion generated some interesting questions about the nature of list fields, as well as the nature of the tags field, and when it was useful / appropriate to use tags and when it was useful / appropriate to use list fields. That's really my question. 

Thanks for seeking clarification :)

//steve.

Stephan Hradek

unread,
Mar 23, 2018, 2:25:51 PM3/23/18
to TiddlyWiki
I wouldnt have tagged the illustration tiddlers at all. After all: They are already named "Illustration X" so a simple "prefix[Illustration ]" filter would do.

Unfortunately automatic sorting of the tiddlers isn't possible yet. There is a plugin which could do that https://groups.google.com/forum/#!topic/tiddlywiki/fJ-kKaxRwy0 and I wish it would be part of the core.

Diego Mesa

unread,
Mar 23, 2018, 3:58:52 PM3/23/18
to TiddlyWiki
Hey Stephan,

Just letting you know that sortan is now part of the core (currently in prerelease):

Mark S.

unread,
Mar 23, 2018, 4:17:10 PM3/23/18
to TiddlyWiki
What was the problem with the <<tab>> approach? If it was just the sort order, add a field "sortby" to each illustration with a double buffered illustration number ("01", "02" ... "31" ....)

Then

<<tabs "[tag[Illustrations]sort[sortby]]"
\\

 "$:/state/tab2" "tc-vertical">>

should work.
 
-- Mark

Steven Schneider

unread,
Mar 23, 2018, 4:59:54 PM3/23/18
to TiddlyWiki
Not a technical problem, a visual problem. He wanted to be able to leaf through illustrations without shifting tiddlers, and the tabs approach wasn't really doing it for him. Mostly: I'm interested here in understanding how list field differs from tag field, and how they can be used to accomplish different types of things. 

TonyM

unread,
Mar 23, 2018, 7:28:54 PM3/23/18
to TiddlyWiki
Steven,

I suppose the importance of the tag field is its supporting tools like tag pills, filters and tags as tiddlers. Personally I have started to reduce my use of tags in favour of reserving them for adhoc or hierarchical relationships.

The list fields is a special case of using a field as a list of titles, where if you have drag-able lists, for example of items tagged with a specific tag you can set the order with drag and drop. Thus I leave it alone for that purpose.

Even the existence of a field can act like a tag once you become familiar with field filters note the has[fieldname] filter demands the field have a value, even one space character.

I am gradually starting to use custom fields, listops and tools rather than using too many tags. One use of using another field as a list of titles (not the tags or list fields) is for subjects or categories that differ from tags. Once a tag exists it is available to all tiddlers to tag them, if you use tags for subjects and categories it is not easy to tell the different functions of different tags unless you add this to the naming standard.

Of late I am playing with Jeds GenTags plugin  
Which provides the partial equivalent of additional tags fields, which I am using for subjects and Categories, each additional field has its own list of candidate titles, rather than from all tags.

I am starting to see limitations with the tabs widget, that may have something to do with your students issue, however your code snipit I would describe as "Populate a field with a list of titles" could help here.

Thanks for sharing
I hope my perspective throws a little light on the subject.

Tony

Steven Schneider

unread,
Apr 4, 2018, 5:02:10 PM4/4/18
to TiddlyWiki
Thanks, Tony, for the insights.And, for reminding me of the GenTags plugin; I'd lost track of that one, and it is really helpful.  //steve.

TonyM

unread,
Apr 5, 2018, 7:15:29 AM4/5/18
to TiddlyWiki
Your Welcome Steve,

An Update on my note in the Previouse post. 

I said "note the has[fieldname] filter demands the field have a value, even one space character."

If you add the "suffix" we can say
has:field[fieldname]
will detect if the field exists with or without any value.

Regards
Tony
Reply all
Reply to author
Forward
0 new messages