[TW5] Open all the tiddlers with a particular tag

3,472 views
Skip to first unread message

Jon

unread,
Jun 20, 2014, 3:26:03 AM6/20/14
to tiddl...@googlegroups.com
Hi

I'd find it really useful to be able to simultaneously open all the tiddlers with a particular tag and then close them all again.

Is that already possible?

Thanks
Jon

Danielo Rodríguez

unread,
Jun 20, 2014, 4:19:19 AM6/20/14
to tiddl...@googlegroups.com
Fast response: no.

Not so fast: No but....

It will not be very hard to build a plugin or customize any of the existing a bit to achieve this. The close all button closes all tiddlers. Is just a matter of add a filter to it.

What is  your use case?


Regards.

Matabele

unread,
Jun 20, 2014, 4:22:37 AM6/20/14
to tiddl...@googlegroups.com
Hi

There is a hack that does something similar:

1. store a space separated list of tiddlers with the given tag to a text-reference somewhere (typically a field or data tiddler entry.)
2. set the value of the 'list' field of '$:/StoryList' to this value.

This overwrites the storylist, rather than adding to it. To add a list of tiddlers to the storylist is a little more difficult.

I am working on a widget that will set the value of a text-reference to the value of the output of a filter expression. This could be used to directly set the list field of '$:/StoryList' to the output of any filter expression (there's a small issue with regards space separated and comma separated lists that I am currently trying to resolve.)

Would this suit your needs?

regards

Ton Gerner

unread,
Jun 20, 2014, 6:01:47 AM6/20/14
to tiddl...@googlegroups.com
Hi Jon,

I asked for it a long time ago (November 2013) [1] and Jeremy opened an issue [2].
So, it is "on the list".

I hope it will be in soon ;-)

Cheers,

Ton


[1] https://groups.google.com/d/msg/tiddlywiki/nsJT0bx1eZ0/qPI1yJfENg0J
[2] https://github.com/Jermolene/TiddlyWiki5/issues/192

Jon

unread,
Jun 20, 2014, 6:03:38 AM6/20/14
to tiddl...@googlegroups.com
Hi Danielo, I use my wiki mainly for study where a tag would represent a particular topic. In order to review a topic, I need to open the tiddlers one by one, so being able to open them all at once would be useful.
Hi Matabele, a bit technical for me! I'll wait for your widget and have a go.

Thanks, Jon.

Jon

unread,
Jun 20, 2014, 6:04:45 AM6/20/14
to tiddl...@googlegroups.com
Ah, that's good Ton. Thanks

wimm

unread,
Jun 21, 2014, 4:30:02 AM6/21/14
to tiddl...@googlegroups.com
I used the default tiddler to accomplish this
  1. import the sidebar home button tiddlers by ton tw5custom.tiddlyspot.com $:/_home-button and $:/_images/home-button
  2. add the filter [all[tiddlers]tag[MYBOOK]sort[title]] in the  (sidebar >>control panel>>basics>>default tiddlers) where you should replace MYBOOK by the name of the tag you want 
  3. then press the home button, ONLY the new default tiddlers including the ones WITH your TAG are shown now.

  1. if you add more lines each with different tags, all the tiddlers tagged with those tags will be shown (grouped per tag).....
  2. you can leave out the title sort or  change it in !sort[modified] to show the latest one on top.
  3. you could also replace MYBOOK by {{tagName}} then you can edit the tiddler tagName instead of changing the contents of default-tiddlers, before you press Home-button.
You can see an example at tw5ideas.tiddlyspot.com which shows you a dummy linear Mybook at startup. In my TW the default tiddlers can be changed in the sidebar>>View-tab. 
In this TW I also added a search string, to only show the ones that contain a given string. And had to add an exclude for a template tiddler: [all[tiddlers]tag[mybook]sort[title]!prefix[$:/template]search{$:/temp/advancedsearch}].
You can easily modify the book in Sidebar>>-My-tab >> MyBook. 

Ton Gerner

unread,
Jun 21, 2014, 5:00:51 AM6/21/14
to tiddl...@googlegroups.com
Hi all,

The solutions I see here are workarounds where you have to manually change the tag.
What I did ask for in the past was a little bit different and more general [1]:

Request 1)
Open all tags.
One of the features in TW classic is: Open all tags when clicking on a tag in a tiddler (or in the sidebar: Tags).
In one click you can open all relevant tagged tiddlers.


Jeremy made it even more general [2]:

Extend the link widget so that it can link to multiple tiddlers at once by specifying a filter identifying the target tiddlers. This would allow us to implement "open all tiddlers with this tag" option to the tag dropdown, and would allow us to drag all tiddlers with a particular tag by dragging the tag pill.

I hope that will be in soon ;-)

Matabele

unread,
Jun 28, 2014, 1:53:23 AM6/28/14
to tiddl...@googlegroups.com
Hi Jon

I have uploaded my new <$makelist> widget to: http://gwiz.tiddlyspot.com/

The Demo for the widget shows how this widget may be used to open all tiddlers with a given tag (for the purposes of the demo these are opened in a substory of the Menu tiddler, but the code may easily be changed to open the tiddlers in the main story river.) 

The Menu links on the site also serve as usage examples -- in this case the filter is a simple list of tiddlers.

Hope this fits your needs.

regards

On Friday, June 20, 2014 9:26:03 AM UTC+2, Jon wrote:

Jon

unread,
Jun 28, 2014, 3:06:58 AM6/28/14
to tiddl...@googlegroups.com
Hi Matabele,

Thats super - I've managed to transfer it to my own wiki and it's working fine - really useful.

I hesitate to ask for anything else but is it an easy thing to just show the (clickable) titles of the tiddlers which have the particular tag - would this be the case if it was in the Main Story river?

Thanks, Jon.

Matabele

unread,
Jun 28, 2014, 4:24:01 AM6/28/14
to tiddl...@googlegroups.com
Hi Jon

Not sure if this is what you had in mind -- have a look at the 'Demo for Jon' at: http://gwiz.tiddlyspot.com/

Couldn't get the pills to work with one click -- I suppose a macrocall is needed to insert the current title.

regards

Matabele

unread,
Jun 28, 2014, 4:40:55 AM6/28/14
to tiddl...@googlegroups.com
Hi Jon

OK -- appear to have it working now with a single click using a <$setfield> widget. Don't know if the timing between the two widgets will be synchronised in all cases though.

Anyway, give it a try -- perhaps it will work out for you.

regards

Jon

unread,
Jun 28, 2014, 6:05:08 AM6/28/14
to tiddl...@googlegroups.com
Hi Matabele,

That looks very interesting too - I'll play around with it and add it to all your other improvements! But what I was really after is probably a lot simpler. Your MakeListDemo transcludes the tiddlers with a particular tag but you mention this could also be adapted for the main story river - How do you do that?  And would this mean that when you clicked "Show Tagged" the tiddlers with that tag would appear under the "Open" tab on the right-hand side?

Thanks, Jon.

Matabele

unread,
Jun 28, 2014, 6:42:39 AM6/28/14
to tiddl...@googlegroups.com
Hi Jon

OK -- try this code:

<$select field="target" default='(none)'>
<option value="null">(none)</option>
<$list filter="[all[tiddlers]tags[]sort[title]]">
<option value=<
<currentTiddler>>><$view field="title"/></option>
</$list>
</$select>
<$makelist tiddler="$:/StoryList" filter="[tag{!!target}]">
<$button message="tw-make-list">Show Tagged</$button>
</$makelist>

regards

Matabele

unread,
Jun 28, 2014, 6:54:52 AM6/28/14
to tiddl...@googlegroups.com
Hi Jon

If this code is used in the main story river, the tiddler with the select widget will be lost from view. I have, therefore, added a 'Tagged' tab in the sidebar at: http://gwiz.tiddlyspot.com/ -- this should suit your needs.

regards


On Saturday, June 28, 2014 12:42:39 PM UTC+2, Matabele wrote:
Hi Jon

Jon

unread,
Jun 28, 2014, 6:55:04 AM6/28/14
to tiddl...@googlegroups.com
Hi Matabele,

I've got your MakeList Demo working in my wiki but when I copied this code into a new tiddler and tried it, (after saving and refreshing) the only action was to close the tiddler - am I missing another bit of code somewhere?

Thanks
Jon

Matabele

unread,
Jun 28, 2014, 7:08:01 AM6/28/14
to tiddl...@googlegroups.com
Hi Jon

The Demo code works in two stages:

1. The value of the tag selected with the <$select> widget is stored to a field somewhere
2. This value is then retrieved and used by the <$makelist> widget to set the list in '$:/StoryList'

These two text-references must match in order for the code to work -- if you have a look at the code in the 'List all Tagged' tiddler at: http://gwiz.tiddlyspot.com/ -- you will see that I have specified both the tiddler title and field name for both the <$select> widget and the <$makelist> widget -- this ensures these two text-references match.

regards

Jon

unread,
Jun 28, 2014, 7:20:11 AM6/28/14
to tiddl...@googlegroups.com
Hi Matabele,

Your reply is a little bit beyond me and it might be in response to me being unclear earlier but apologies if the only confusion is on my part!!

The MakeList Demo is working fine in my wiki, but when I copied the newly suggested code into a tiddler in my wiki, it wouldn't work. I tried copying it into your wiki and that didn't work either.
I've taken up enough of your time already, so don't rush to reply.

Thanks
Jon

Matabele

unread,
Jun 28, 2014, 8:21:20 AM6/28/14
to tiddl...@googlegroups.com
Hi Jon

No problem -- select the 'Recent' tab in the side menu at: http://gwiz.tiddlyspot.com/ -- then drag the link 'List all Tagged' onto your TiddlyWiki.

This will give you a new 'Tagged' tab in the side menu of your wiki which should meet your requirements (you also need the <$makelist> plugin.)

regards 
Message has been deleted

paolo b

unread,
Jun 28, 2014, 8:32:59 AM6/28/14
to tiddl...@googlegroups.com
Hi Matabele

just installed, it's very useful!

Thank you

Paolo

Jon

unread,
Jun 28, 2014, 10:04:31 AM6/28/14
to tiddl...@googlegroups.com
Perfect! Thank you.
Jon

David Moore

unread,
Mar 2, 2015, 4:15:48 PM3/2/15
to tiddl...@googlegroups.com
Hi, I am having the same issue.  In classic you could simply click a tag and either open a specific matching tiddler, or "open all" which gave you everything that matched.

I used this more than anything given I categorised everything with tags.

However in the new version the feature has gone, and it seems from the above quite a lot of hacking and code to resolve!


In the above link it says that you can still open all tiddlers tagged to a given tag, however I can't see how.

Any news since this last post, or any simple step by step instructions for implementing the above?

Thanks

Dave

David Moore

unread,
Mar 2, 2015, 4:44:02 PM3/2/15
to tiddl...@googlegroups.com
Hi again, I tried to use the "Demo for Jon".

I dragged the makelist widget to my wiki, and it showed me an import dialogue, which I followed.

I then copied the code into a new widget, and I get "Undefined widget 'makelist'" appearing...

I don't know what else I am supposed to do to "install" a widget?

Jed Carty

unread,
Mar 2, 2015, 5:15:27 PM3/2/15
to
David,

Currently there isn't any simple way to open up all tiddlers with a given tag, but there is one in the prerelese of the next version and will be in it when version 5.1.8 comes out (version here in the sense of an update or revision, not version in the sense of tiddlywiki classic vs tiddlywiki 5).

You can easily list all tiddlers with a given tag using the list widget and filters. I know this doesn't actually give you what you want, but it may help until version 5.1.8 is released, which will hopefully be very soon.

If you click on a tag that a tiddler is tagged with, or in the tag manager on the more tab of the sidebar menu, than you will also get a list of tiddlers that have that tag.

I have added a tiddler that lets you open all tiddlers with a chosen tag to my experimental tools site, but at the moment it requires the prerelease.

Also, you need to save and reload before a plugin will work, so that may be your problem using the makelist widget.

David Moore

unread,
Mar 3, 2015, 1:56:06 AM3/3/15
to tiddl...@googlegroups.com
Hi, it would be nice to get this working sooner rather than later, so I tried again with Matabele's answers.

I dragged the makelist widget again, (after  complete restart) and it said it would not import because version older than existing version (they were actually the same).  So I do have it installed, and I see under More -> System that I have plugins/matabele/makelist and makelist.js listed as two items.

However I still get the "undefined widget makelist".  Is there something else you need to do when installing a widget?


RichardWilliamSmith

unread,
Mar 3, 2015, 5:34:21 AM3/3/15
to
Hi David,

I made an example of how I have used 'makelist' to do this


Regards,
Richard

PS: because I will remove the file in future, I'll copy this here, for the sake of the thread

Once you have Matabele's makelist widget installed (drag this link if you don't)...
$:/plugins/matabele/makelist
...you can write code like this to make a button that opens all the tiddlers with a particular tag (and closes the others)
<$makelist tiddler="$:/StoryList" set="!!list" filter="[tag[About]]">
<$button class="tc-btn-text" message="tw-make-list">
Open About
</$button>
</$makelist>


Felix Küppers

unread,
Mar 3, 2015, 5:57:12 AM3/3/15
to
Hi Jon,

TL;DR

Maybe another simple idea that should work (haven't tested it though)
  1. Backup "$:/DefaultTiddlers" value to another tiddler called "$:/DefaultTiddlers.bak"
  2. change tags field of "$:/DefaultTiddlers" to "[tag[mytag]]"
  3. (optionally close all tiddlers in river via "tm-close-all-tiddlers")
  4. initiate the "tm-home" message
  5. all tiddlers with that tag will open
  6. Restore "$:/DefaultTiddlers" value from "$:/DefaultTiddlers.bak"

-Felix

David Moore

unread,
Mar 4, 2015, 3:34:31 AM3/4/15
to tiddl...@googlegroups.com
Thanks for that, really appreciate it.

It seems that I have been doing it right, so I don't know what's wrong.

the plugin is installed, as it won't let me drag the link there again
however I still get makelist not defined

See picture of more -> system, import, plugin and code here.


Perhaps the plugin is installed incorrectly, although not sure how that can happen.  Does it have any dependencies?

any further help greatly appreciated.  

David Moore

unread,
Mar 4, 2015, 3:40:20 AM3/4/15
to tiddl...@googlegroups.com
Right, I deleted the plugin tiddler, and then dragged again, and this time it works, so problem solved.

Thanks for all your help everyone!

rauh...@gmail.com

unread,
Jun 6, 2016, 3:48:07 AM6/6/16
to TiddlyWiki
Hello together,

I wanted to ask if there has been progress on the 'clickable tags' request here. I am rather new in using TiddlyWiki, but I miss this particular tool really much, as I don't want to open all tagged Tiddlers one by one. I am searching for an option to open all tagged Tiddlers at once by clicking on the tag. Using filters, I just got another list of links, but no automated opening of the Tiddlers.  In a previous post it was mentioned that this option will be available with version 5.1.8, which is not actual anymore. Did the feature got lost again, or am I missing something?

With kind regards,
D.

Mat

unread,
Jun 6, 2016, 5:13:09 AM6/6/16
to TiddlyWiki
On Monday, June 6, 2016 at 9:48:07 AM UTC+2, rauh...@gmail.com wrote:
Hello together,

I wanted to ask if there has been progress on the 'clickable tags' request here. I am rather new in using TiddlyWiki, but I miss this particular tool really much, as I don't want to open all tagged Tiddlers one by one. I am searching for an option to open all tagged Tiddlers at once by clicking on the tag. Using filters, I just got another list of links, but no automated opening of the Tiddlers.  In a previous post it was mentioned that this option will be available with version 5.1.8, which is not actual anymore. Did the feature got lost again, or am I missing something?


Hi rauh.. / D, I just put together this simple macro. Maybe it's enough?


<:-)

cmari

unread,
Jun 6, 2016, 10:44:32 PM6/6/16
to TiddlyWiki
I wanted the possibility to "open all" [tagged tiddlers] when I click on a tagpill, so I did the following:
In the shadow tiddler $:/core/ui/TagTemplate
after the line that consists only of <hr>
insert:
<$button class="tc-btn-invisible"><$list filter="[all[current]tagging[]]"><$action-navigate $to=<<currentTiddler>> /></$list>Open All</$button><hr>

cmari

Thomas Elmiger

unread,
Jun 7, 2016, 4:51:19 PM6/7/16
to tiddl...@googlegroups.com
This is one of these things: you realise, how much you missed it, when you use it. It went directly in my tag pill menu – at the bottom though (insert just before the last div).
Thank you all!

Thomas

Maaaaaaaaaaaaaaartin

unread,
Jul 14, 2016, 6:33:47 AM7/14/16
to TiddlyWiki
This is incredibly useful, thanks! One question though: how are the tiddlers sorted? Ideally, I would like to have them in reverse chronological order (of creation date)…is it possible? Thanks! Martin

Jan

unread,
Jul 15, 2016, 6:37:49 PM7/15/16
to tiddl...@googlegroups.com
Hello together,
I tried to modify Mats solution adding an Input-field linking to a field called sesame...(Supposing that sesame contains the Tag to open...):

\define openalltagged()
<$set name="label" value={{!!sesame}}>
<$edit-text field="sesame"/>
<$button class="openalltagged">
open all tagged $label$
<$list filter="[tag[$label$]]" variable="tid">
<$action-navigate $to=<<tid>>/>
</$list>
</$button>
</$set>
\end

<<openalltagged>>

Unfortunately I do not get the Variable to work. This is a repeating question for me: where in the code do I have to set the name to make it work.

8-?
Jan
--
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 post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/8cdfd2a4-de42-45a7-84ba-d5e6a6481798%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matabele

unread,
Jul 16, 2016, 4:10:57 AM7/16/16
to TiddlyWiki

Hi


The $action-listops widget (now included in the core) may be used for this functionality, using the $filter= attribute option:


\define getTiddlers()
<$button class="btn-invisible">$(tag)$
<$action-listops $tiddler="$:/StoryList" $field="list" $filter="[tag[$(tag)$]]"/>
</$button>
\end

Note: This doesn't update the history

regards

Stanley T

unread,
Jul 23, 2017, 6:21:24 PM7/23/17
to TiddlyWiki
Hi Matabele and all searching for the same question.

Thanks for the posted code!  I would recommend before trying to use it and getting frustrated (like me) to check out two links:

http://tiddlywiki.com/static/ListWidget.html


For a couple of Tiddlers that I have tagged Journal, I change Mark's notation to this: 
<$button class="btn-invisible">$(tag)$
<$action-listops $tiddler="$:/StoryList" $field="list" $filter="[tag[Journal]]"/>
</$button>

From Matabele: 

Christopher Arcadia

unread,
Jul 26, 2017, 12:41:37 AM7/26/17
to tiddl...@googlegroups.com
Thought I might post the macros I use for opening & closing tiddlers based on a filter:

<<openByFilter "[tag[mytag]]">>

<<closeByFilter "[tag[mytag]]">>


\define closeByFilter(filter)
filter
: $filter$
<$button>
close filtered tiddlers
<$list filter=$filter$>
<$action-sendmessage $message="tm-close-tiddler"/>
</$list>
</
$button>
\end

\define openByFilter(filter)
filter
: $filter$
<$button>
open filtered tiddlers
<$list filter=$filter$>
<$action-navigate $to={{!!title}}/>
<$action-sendmessage $message="tm-unfold-all-tiddlers"/>
</$list>
</
$button>
\end

TonyM

unread,
Jul 27, 2017, 10:55:09 PM7/27/17
to TiddlyWiki
Christopher Arcadia ,

That's cool thanks, added to my standard macros.

Regards
TonyM

Andrew

unread,
Jul 28, 2017, 9:41:14 AM7/28/17
to TiddlyWiki

Mike Andyl

unread,
Jul 4, 2021, 9:24:55 AM7/4/21
to TiddlyWiki
Please tell me pls why these buttons do not work?

\define openByFilter(filter)
<$button>
open filtered tiddlers $filter$

<$list filter=$filter$>
<$action-navigate $to={{!!title}}/>
<$action-sendmessage $message="tm-unfold-all-tiddlers"/>
</$list>
</$button>
\end

\define closeByFilter(filter)
<$button>
close filtered tiddlers $filter$

<$list filter=$filter$>
<$action-sendmessage $message="tm-close-tiddler"/>
</$list>
</$button>
\end

<$select field="target" default='(none)'>
<option value="null">(none)</option>
<$list filter="[tags[]!is[system]sort[title]]">

<option value=<<currentTiddler>>><$view field="title"/></option>
</$list>
</$select>

<<openByFilter "[tag[{{!!target}}]]">>

<<closeByFilter "[tag[{{!!target}}]]">>


пятница, 28 июля 2017 г. в 16:41:14 UTC+3, Andrew:

Soren Bjornstad

unread,
Jul 4, 2021, 9:34:28 AM7/4/21
to TiddlyWiki
This isn't the correct filter syntax for transcluding a field into the filter:

<<openByFilter "[tag[{{!!target}}]]">>

You probably want:

<<openByFilter "[tag{!!target}]">>


Mike Andyl

unread,
Jul 4, 2021, 4:59:09 PM7/4/21
to TiddlyWiki
Uh, I'm completely confused about these variable symbols.
<<>>[[]]{}!!$()$
Now the button works, but its name is not set, it remains the same. How to deal with this?
https://i.imgur.com/qLFu2cl.jpg
воскресенье, 4 июля 2021 г. в 16:34:28 UTC+3, Soren Bjornstad:
Message has been deleted

Mike Andyl

unread,
Jul 5, 2021, 3:00:55 PM7/5/21
to TiddlyWiki
And by the way, there is an error in the code, that's more correct for the open button.


<$list filter=$filter$>
<$action-navigate $to={{!!title}}/>
</$list>
<$action-sendmessage $message="tm-unfold-all-tiddlers" foldedStatePrefix="$:/state/folded/"/>

And don't do it in a  /$list loop!

воскресенье, 4 июля 2021 г. в 23:59:09 UTC+3, Mike Andyl:
Reply all
Reply to author
Forward
0 new messages