Advanced Search Filter tab text not working in Tiddler code

I am trying a more complex filter as follows:

text={{{ [[Object type: ]] [{$:/TLS/object_type}] [[<br>Date Start: ]] [{$:/TLS/date_start}] [[<br>Date end: ]] [{$:/TLS/date_end}] [{$:/TLS/date_end}] [[<p>]] [{$:/TLS/incremental}addprefix[CS]addprefix[{{]addsuffix[}}]] }}}

If I type this into the Advanced Search Filter tab, the result I get is
Screen Shot 2023-07-10 at 1.07.16 pm

with when the data tiddlers are instantiated, the values for the first three items shown as well (although not in this screengrab).

which, after removing the {{{ and }}} and copying it into a new tiddler gives me the result

Screen Shot 2023-07-10 at 1.07.24 pm

This, apart from the small PDF container which I can not explain, is the result I want.

However, when I add this filter into my actual code, I get the result

which is missing most of the text content

So, in the Advanced Search tab, the filter works as expected because when I copy the result, removing the {{{ and }}}, into a new tiddler it correctly display the result I am after.

This is the complete action widget code is:

<$action-createtiddler $basetitle={{$:/TLS/object_title}} tags="Items to_be_tagged" text= {{{ [[Object type: ]] [{$:/TLS/object_type}] [[<br>Date Start: ]] [{$:/TLS/date_start}] [[<br>Date end: ]] [{$:/TLS/date_end}] [{$:/TLS/date_end}] [[<p>]] [{$:/TLS/incremental}addprefix[CS]addprefix[{{]addsuffix[}}]] }}} object_type={{$:/TLS/object_type}} date_start={{$:/TLS/date_start}} date_end={{$:/TLS/date_end}} object_link={{$:/TLS/object_link}}

So why is the Advanced Search tab result different from the tiddler code result?

It does not appear to be an issue of the spaces between the filter steps as removing them makes no difference.

Why is the code not working as expected? I am obviously doing something wrong in the filter but have no idea as to what.

I should also add that I am getting so far only because of @EricShulman’s simple statement about brackets with the example of my previous filter issue. Thanks Eric, your simple statement is easily understandable.

bobj

The triple-curly-brackets notation can’t be used inside of a filter expression.

The below should work since the filtered transclusion bits are removed.

[[Object type: ]] [{$:/TLS/object_type}] [[<br>Date Start: ]] [{$:/TLS/date_start}] [[<br>Date end: ]] [{$:/TLS/date_end}] [{$:/TLS/date_end}] [[<p>]] [{$:/TLS/incremental}addprefix[CS]addprefix[{{]addsuffix[}}]]

Remember that {{{ }}} is somewhat of a shorthand for <$/list filter="[ ]" ><$transclude /></$list>

The filter tab in Advanced Search is putting your filter runs inside those outer square brackets, so you have to stick with the single-brackets usage that is required inside filter runs.

When a “filtered transclusion” is used to specify a widget parameter, only the value of the first non-empty filter run is used as the parameter value. To create a single text value that incorporates all of the filter runs, you need to add +[join[]] at the end of the filter.

Something like this:

text={{{
   [[Object type: ]] [{$:/TLS/object_type}]
   [[<br>Date Start: ]] [{$:/TLS/date_start}]
   [[<br>Date end: ]] [{$:/TLS/date_end}]
   [[<p>]]
   [{$:/TLS/incremental}addprefix[CS]addprefix[{{]addsuffix[}}]]
   +[join[]]
   }}}

Thanks @EricShulman, another simple explanation. Is this limitation documented anywhere?

If not, should it not be, maybe on the tiddler Filtered Transclusion?

I am happy to assist in the documentation process if someone can advise me on how to do that, assuming my help is accepted of course.

Bobj

@EricShulman,

your suggested join statement would not work until I removed all spaces between filter steps, especially the one between the + and the [join]]

I seem to remember from an earlier query that you should not have spaces between filter steps.

I’m getting better, thanks to all for your patience :slightly_smiling_face:

bobj

You can have spaces in between filter runs, but you cannot have a space between + and [join[]]. It has to be +[join[]]

1 Like

@Bob_Jansen spaces are ok “between filter runs”, the outer [filter] spaces [filter] one example is a list of tiddlers

  • tiddlername [[tiddler with space]] [[another tiddler]], in a way each tiddler name is a whole filter run each, with there own outer [ ] and because they are ‘literal text’ there own inner [ ] (if needed), and space separated, but tiddlywiki is smart enough to split tiddler[[one]][[two]]
  • Another way to describe a tiddler title is like this [title[titlename]] which if you think about it is the same as the general [fieldname[fieldvalue]]
  • but “no spaces in filter operators and the run prefixes” like +[join[ ]] but space is valid inside the operator.
  • However do note - sometimes This forums editor has a habit of inserting a space here and there.

When trying to learn filters the filtered transclusion is great {{{ tiddler[[one]][[two]] }}}, when not used as an attribute it returns all values.

  • But with 5.3.0 we also get functions and for attributes ${ filter }$ wrapped in backticks.