Operator that supports filters wihout formatting as link

70 views
Skip to first unread message

Jared Lettau

unread,
Feb 11, 2020, 7:32:58 PM2/11/20
to TiddlyWiki
I'm trying to get a filter result return without link formatting.

Context:
  • Trying to return the count of tiddlers that match a filter.
  • The only operator I know which can do this is the list operator.
  • However, list always returns link formatting.

What's I've considered:
  • Different operator that doesn't return link formatting - Unable to locate such an operator.
  • Vars - Vars either retain formatting, or simply run the list operation whenever called... either way, a var set to the result of list operator retains link formatting.
  • Span - wrap html formatting around list operator - doesn't override TW formatting.
Example of the problem:

Thanks in advance!
</jared>

Mark S.

unread,
Feb 11, 2020, 7:46:08 PM2/11/20
to TiddlyWiki
Here's two ways, as a starter:


<$list filter="[search:hex[0000]count[]]" emptyMessage="0" >
<$text text=<
<currentTiddler>>/>
</$list>

<$set name="len1" filter="[search:hex[0000]count[]]" >
<
<len1>>
</$set>


Mat

unread,
Feb 11, 2020, 8:24:02 PM2/11/20
to tiddl...@googlegroups.com
I'm about to go sleep so this is a bit sloppy:
You can try:

To just get a tiddler title not linkified, use the ViewWidget with format=text 

Using the SetWidget and attribute select=0
If you use the SetWidget result in a filter (e.g in the ListWidget), you must use the enlist operator, i.e enlist<yoursetvariable>

Or the WikifyWidget which takes a lot of memory so don't e.g put it in a loop. Note that you can use it like so:

<$wikify name=foo text={{{ filter }}} >

Quoting from Jeremy below: "[this] evaluates the filter and returns the first result as the value of the attribute. So the effect [...] is to process the first result of the filter as if it was wikitext, and then return the text portion of the resulting HTML."

<:-)

Jared Lettau

unread,
Feb 12, 2020, 4:32:46 PM2/12/20
to tiddl...@googlegroups.com
Great suggestions! I didn't realize <<currentTiddler>> would show the current list stdout, i thought it would always show the title of whatever tiddler was being evaluated... good trick. Nice use of use of set as well.

Didn't realize wikify and setwidget would do this as well... I need to play with those more...

Thanks again!
</jared>


On Tuesday, February 11, 2020 at 4:32:58 PM UTC-8, Jared Lettau wrote:

TonyM

unread,
Feb 12, 2020, 8:26:57 PM2/12/20
to TiddlyWiki
Jarard

A little more info

The list widget has a template parameter which defaults to the listitem template, otherwise it uses the content of the list widget (between list open and close) to define how to display the list items. The examples given to you use this method but you could create your own template tiddler.

Regards
Tony

Jeremy Ruston

unread,
Feb 13, 2020, 11:50:12 AM2/13/20
to TiddlyWiki
Hi Mat

On 12 Feb 2020, at 01:24, Mat <matia...@gmail.com> wrote:

I'm about to go sleep so this is a bit sloppy:

There’s actually a correction to make; it might be worth updating your original post to make sure future searchers don’t get led astray.

Or the WikifyWidget which takes a lot of memory so don't e.g put it in a loop. Note that you can use it like so to get a filter result:

<$wikify name=foo text={{{ filter }}} >


Setting an attribute to {{{ filter }}} doesn’t do that: it evaluates the filter and returns the first result as the value of the attribute. So the effect of your example is to process the first result of the filter as if it was wikitext, and then return the text portion of the resulting HTML.

Best wishes

Jeremy.

Mat

unread,
Feb 13, 2020, 1:12:10 PM2/13/20
to TiddlyWiki
Jeremy Ruston wrote:
There’s actually a correction to make; it might be worth updating your original post to make sure future searchers don’t get led astray.

Thanks! I hope I updated it correctly.

<:-)
Reply all
Reply to author
Forward
0 new messages