[TW5] How list current tags but excepting some of them

80 views
Skip to first unread message

Mat

unread,
May 11, 2016, 8:46:42 AM5/11/16
to TiddlyWiki
Gaaah! This is just driving me crazy! I simply want to:

 list the current tiddlers tags with some of them removed so I can perform operations with the remaining ones.

As illustrated here (except this doesn't work)


<$list filter="[<currentTiddler>get[tags]remove[aa]]" variable="item">
<
<item>>
</$list>

One reason why it doesn't work is, I think, because "remove" is a listop and the previous step is not in list form. But then... 

"[list[{currentTiddler!!tags}]] +[remove[aa]]"

...doesn't work either. Nor do a big bunch of other combos I've tried.

I wish to avoid nested listings.

ATM I only neet do remove one tag (here "aa").from the list


Please help.


<:-)


magev958

unread,
May 11, 2016, 10:16:48 AM5/11/16
to TiddlyWiki
Doesn't

-[tag[aa]]

work?

Mark S.

unread,
May 11, 2016, 10:51:23 AM5/11/16
to TiddlyWiki
I think "get" must return everything as one string rather than a list of objects. I notice that the <<item>> appears on one line, even if you insert a <br/>. But  this seems to work:

[<currentTiddler>tags[]] -[[aa]]


Mark

Mat

unread,
May 11, 2016, 5:03:42 PM5/11/16
to TiddlyWiki
Mark and magev, thank you!

Yes, Marks solution is what cracked the nut! For the record, here are some holy macaronis identified after much work. Not that I know how anybody will find this in the archives later on but anyway:


Holy Macaroni #1 - List the content of a field as a list of items, (NOT as one unit/link)
Here:List the tags of the current (and pick out only the second one - mostly to ensure it's accessible)

<$set name="set" filter="[list[!!tags]nth[2]]">
<
<set>>
</$set>


Holy Macaroni #2  - Controlled removal by retrieving field content as list (NOT as one unit/link) 
Here specifically: Fetch current tiddlers tags and remove aa from them. Returns all remaining tags.

<$set name="set" filter="[<currentTiddler>tags[]] -[[aa]]">
<
<set>>
</$set>


Holy Macaroni #3 - Check if a value is listed in a field for a tiddler.
Specifically: Checks if aa is listed in the tags field of the tiddler Foo

<$set name="set" filter="[[aa]listed[tags]field:title[Foo]]">
<
<set>>
</$set>


Something cool is in the making.

<:-)

Reply all
Reply to author
Forward
0 new messages