A way to view List-search results in a tab?

Hi everyone

If I add a list-search macro to a tiddler, it shows fine. If I then transclude the tiddler into a tab, it shows the search window, but not the results. Compare the two tiddlers in this file for an example.

Is there any way around this?

The problem is caused by the filter using all[current]. When shown as a stand-alone tiddler, this works just fine. However, when shown in a tab, the value of <<currentTiddler>> is the tiddler in which the tabset is defined, not the tiddler containing the tab content.

Fortunately, there is an easy fix…

In the tiddler containing the tab content (i.e., “NT 1 (Evangelios)”), add the following line at the start of the tiddler:

<$tiddler tiddler=<<currentTab>>>

When viewed as a stand-alone tiddler, the value of <<currentTab>> is undefined, so this line does nothing, and the <<list-search>> macro works as before. But, when viewed in a tabset, the value of <<currentTiddler>> is set to match the <<currentTab>> value, which is the title of that tab tiddler, so the all[current] contained in the filter syntax now refers to the correct tiddler.

enjoy,
-e

Thanks Eric! Follow up question: is there a way to do this so that if I put the list-search in a $:/tags/ViewTemplate tiddler instead of in the text field, the content tiddler, along with its viewtemplate content will appear in a tab somewhere else?

Try this:

Create a tiddler named e.g. “MyTabTemplate” containing the following:

<$tiddler tiddler=<<currentTab>>>
<$transclude tiddler=<<currentTab>> mode="block"/>
<<list-search "[!is[system]all[current]tagging[]sort[title]]"
   "search:title" "$:/temp/list-search-example"
   "$:/.giffmex/ListItemTemplate/titleplustransclusion"
   placeholder:"" 
>>

Then, in the tiddler containing your <<tabs>> macro (i.e., “Inicio”), add "MyTabTemplate" to the macro parameters, like this:
<<tabs "[tag[dominio]sort[order]]" "" "$:/state/tabdominio" "tc-vertical" "MyTabTemplate">>

This will apply “MyTabTemplate” to each individual “content tiddler”. Note that, in addition to the <<list-search>> macro and the initial <$tiddler tiddler=<<currentTab>>> widget, “MyTabTemplate” also includes this line:

<$transclude tiddler=<<currentTab>> mode="block"/>

which shows the text from each content tiddler so you can remove the <<list-search>> macro from the content tiddlers since it will be automatically shown via the “MyTabTemplate” instead.

-e

1 Like

Thanks Eric! That is very helpful!

Hi Eric,

I have a problem similar here, but now not with tabs but with a table. I have two list searches, each in a system tiddler. I have another system tiddler tagged $:/tags/ViewTemplate which contains a table, two cells of which transclude the list search tiddlers. So from tiddlers in the story river, I am not getting results where I thought they should be.

This is the list-search, in case that shows me what I am doing wrong:

<span>

<<list-search
"[!is[system]tagging[<current>]sort[title]]"

"search:title"
"$:/temp/list-search-example"
"$:/.giffmex/ListItemTemplate/Text+AsteriskLink"
placeholder:"" >>

</span>

The other is the same but the filter is [!is[system]backlinks[<current>]sort[title]].

The results that show in the viewtemplate (and thus below the tiddlers open in the story river) are ALL the tiddlers with tags ALL with backlinks, not just the tiddlers that tag or backlink to the present tiddler.

What does my filter need to be?

I am assuming the problem is similar to your answer to the original post here, the “current” bit in the list filter. But I am not sure what to put.

Thanks for any help you can give me. Blessings,

Your filter syntax is incorrect.

First, to refer the “present tiddler”, the variable you want to use is <currentTiddler>… not <current>. Second, the tagging[] and backlinks[] filter operators do not take operand values to specify the tiddler title of interest. Rather, they are preceded by the tiddler title in the filter run to provide input to those operators. Thus, you should change:

[!is[system]tagging[<current>]sort[title]]
and
[!is[system]backlinks[<current>]sort[title]]

to

[<currentTiddler>!is[system]tagging[]sort[title]]
and
[<currentTiddler>!is[system]backlinks[]sort[title]]

Let me know how it goes…

-e

Hi Eric

  1. First, thank you for such a quick reply! I got it last night but as I was heading to bed.

  2. Your new syntax got rid of all the wrong tiddlers, so that was big progress. And I always thought most of the elements in list filters did not require a specific order, so I learned something new.

  3. I figured out the last missing piece myself. I replaced currentTiddler with storyTiddler. Now it works like a charm!

Thanks again for your help!