Create New Tiddler with transcluded filter result, possibly using this bit of code wot I found

Hello good and wise people,

I found this lovely bit of code sat unused in one of my wikis. Whence it came from I do not know, It’s some code from @EricShulman, see his reply for an updated copy. though I think we can say with a high degree of confidence it is not my own! It creates a checkbox list of tags then lists tiddlers tagged with the checked boxes.

I post it here for two reasons.

  1. It’s quite useful and might be of use.
  2. I want to change it!

I would like to be able to take the results and output to one tiddler containing transclusions of the filtered results.

It kind of feels like I should know how to do this by now…:slight_smile:

Anyway, here is the code; (thanks in advance).

\define maketagfilter() tag[$(currentTiddler)$]

<style>
.columns8 { display:block; -moz-column-count:8; -moz-column-gap:1em; -webkit-column-count:8; -webkit-column-gap:1em; font-size:60%; line-height:1em; }
.columns4 { display:block; -moz-column-count:4; -moz-column-gap:1em; -webkit-column-count:4; -webkit-column-gap:1em; font-size:80%; line-height:1.4em; }
</style>

__''SELECT TAGS:''__<br>
@@.columns8
<$list filter="[all[tiddlers+!shadows]tags[]sort[]]">
   <$checkbox tiddler="selectedTags" index=<<currentTiddler>> checked=<<maketagfilter>>
        checkactions="""<$action-setfield $tiddler="selectedTags" $index=<<currentTiddler>> $value=<<maketagfilter>> />"""
      uncheckactions="""<$action-setfield $tiddler="selectedTags" $index=<<currentTiddler>> />""">
         <$text text=<<currentTiddler>>/>
   </$checkbox><br>
</$list>
@@
<$wikify name="filter" text="""[all[tiddlers+shadows]<$list filter="[title[selectedTags]indexes[]]">{{{ [[selectedTags]getindex<currentTiddler>] }}}</$list>]""">

__''RESULTS FOR FILTER: <$text text=<<filter>>/>''__<br>
<$reveal text=<<filter>> type="nomatch" default="[all[tiddlers+shadows]]">
@@.columns4 <$list filter=<<filter>>><$link/><br></$list>@@
</$reveal>
</$wikify>

Very useful - thanks already playing with it :grinning:

1 Like

The code looks like a very early version of my https://tiddlytools.com/#TiddlyTools%2FSearch%2FTags

Thanks to Eric and Ste_W

I am adding a simple search to my copy so that I can filter on multiple tags and one text search expression, that should cut down on some head scratching when I cannot remember the full details of the tiddler I want to revisit. :grinning:

@Ste_W I am trying this on TiddlyWiki.com to see what it does and saw this [all[tiddlers+!shadows] which I understand is not correct syntax. If you want to see non shadow tiddlers which are regular tiddlers or edited shadow tiddlers it is sufficient to use [all[tiddlers] or perhaps you are thinking “not is system”.

  • [all[tiddlers+shadows]!is[system]]

Tested on tiddlywiki this generates pages of tags and I don’t see columns

1 Like

Cheers for that @TW_Tones, that is indeed what I was aiming for!
Now I’ve tinkered a little what I think I want is just certain tags to be displayed for selection.
More tinkering required.

1 Like

Many thanks @Ste_W and @EricShulman this is great and will help with houskeeping etc. … I’ve been thinking about a similar issue with fields but that would be better in a separate thread.

I assume that the CSS should display the lists in 8 or 4 columns, respectively, but this doesn’t happen when I try it. Do I need to include anything further?