List tiddlers with common fields

50 views
Skip to first unread message

Mohammad

unread,
Jan 10, 2020, 12:29:42 AM1/10/20
to TiddlyWiki
This may be redundant question but I have not found anything in the forum

  • Consider you have several tiddlers all tagged with myTag
  • These tiddlers have different fields like fa, fb, fc, fd, etc...
  • Not all of them have all above fields But all of them have common fields means all have for example fb, and fd
Question
  • How one can list and display the common fields only? (here fb, and fd)

Note

<$list filter="[tag[myTag]fields[]]" /> 

shows cumulative result means all fields are used from all tiddlers NOT common (shared) fields


--Mohammad

Eric Shulman

unread,
Jan 10, 2020, 2:33:49 AM1/10/20
to TiddlyWiki
On Thursday, January 9, 2020 at 9:29:42 PM UTC-8, Mohammad wrote:
This may be redundant question but I have not found anything in the forum

  • Consider you have several tiddlers all tagged with myTag
  • These tiddlers have different fields like fa, fb, fc, fd, etc...
  • Not all of them have all above fields But all of them have common fields means all have for example fb, and fd
Question
  • How one can list and display the common fields only? (here fb, and fd)
Try this:
<$vars tiddlerCount={{{ [tag[myTag]count[]] }}}>
<$list filter="[tag[myTag]fields[]]" variable="thisField">
   <$vars fieldCount={{{ [tag[myTag]has:field<thisField>count[]] }}}>
   <$reveal default=<<fieldCount>> type="match" text=<<tiddlerCount>>>
      <<thisField>>
   </$reveal>
   </$vars>
</$list>
</$vars>

let me know how it goes,
-e

Mohammad

unread,
Jan 10, 2020, 4:48:32 AM1/10/20
to TiddlyWiki
Added to TW-Scripts.

Many thanks Eric.
Works like a charm!

--Mohammad
Reply all
Reply to author
Forward
0 new messages