Advanced search - filter expressions: how do I force a particular tiddler to appear at the top when exporting to a static page?

298 views
Skip to first unread message

Suzanne McHale

unread,
Oct 2, 2019, 12:25:11 AM10/2/19
to TiddlyWiki
I have tried this filter for one of my Tiddlywikis: [title[Program tips]][!is[system]sort[title]][tags[]!is[system]sort[title]]. "Program tips" is the home/index page and I want it to appear at the top of the static HTML page export, followed by all other pages (alphabetically-sorted) then tags pages. However, "Program tips" only appears in the alphabetically-sorted list of pages in the second expression, and I can't think of the right syntax to force it to appear first. (I have also tried [name[Home]] which I put in one of the fields of "Program tips", but this did not work either.)

Oddly, if I write the filter as [!is[system]sort[title]][title[Program tips]][tags[]!is[system]sort[title]], "Program tips" will then appear after the alphabetically-sorted page titles. There seems to be something in the [!is[system]sort[title]] filter that overrrides other commands. Hope that all makes sense! What am I doing wrong?

TonyM

unread,
Oct 2, 2019, 2:02:54 AM10/2/19
to TiddlyWiki
Suzanne,

Of course you could create a new tag and sort that with drag and drop on the tag pill. I am curious there are no carefully placed spaces which I do not see in the published example.

Here is mine for testing on tiddlywiki.com

<$list filter="[title[SampleModal]]">

</$list>
<$list filter="[!is[system]sort[title]]">

</$list>
<$list filter="[tags[]!is[system]sort[title]]">

</$list>
Is my first response, however the same tiddler will sometimes appear in the two lists.

In your compound filter although you name a tiddler then have two multi tiddler filters the whole set of tiddlers is also reduced to eliminate duplicates within. I think that is removing you first selected tiddler from appearing twice.

With 5.1.20 and the new mathematics operators there is the new retail duplicate method "="

<$list filter="=[title[SampleModal]] =[!is[system]sort[title]] =[tags[]!is[system]sort[title]]">

</$list>
Which seems to work but it is hard to tell the difference between tiddler and tags

I used this to see more, but there are two many tiddlers on tiddlywiki.com that are captured in your filters
<$list filter="[title[SampleModal]]">

</$list>

;Tiddlers
<$list filter="[!is[system]sort[title]]">

</$list>
;Tags
<$list filter="[tags[]!is[system]sort[title]]">

</$list>

Anyway perhaps this can lead to your answer,

Please post back
Regards
Tony

Suzanne McHale

unread,
Oct 2, 2019, 2:14:58 AM10/2/19
to TiddlyWiki
Hi Tony, thanks for your detailed answer! I tried this in the Advanced Search box: =[title[Program tips]] =[!is[system]sort[title]][tags[]!is[system]sort[title]] and it seems to work! The "Program tips" tiddler now appears at the top as I wanted. I will try that with my other Tiddlywikis and see how that syntax goes.

Flibbles

unread,
Oct 3, 2019, 7:52:42 AM10/3/19
to TiddlyWiki
Maybe I'm late to the party, but the following seem to work too:

[!is[system]sort[title]] [[Program Tips]] +[putfirst[]]

or this goofy one:

[!is[system]sort[title]move:-1000000[Program Tips]]

I'd go with the first.

Suzanne McHale

unread,
Oct 4, 2019, 1:38:12 AM10/4/19
to TiddlyWiki
The first one seems to work, thanks! It also avoids the issue of that tiddler being repeated in the [!is[system]sort[title]] list.

Is there also a way of 

  1. putting a particular tiddler last (I tried +[putlast[]] for a different tiddler, but it conflicted with the first + command) and 
  2. excluding my own created $:/tags/Stylesheet and $:/tags/Macro tiddlers? (The latter appear in the tiddlers to be exported.)
(Filter expressions are very useful but seem to be very difficult to get to work the way one wants!)

Flibbles

unread,
Oct 4, 2019, 6:52:09 AM10/4/19
to TiddlyWiki
Sounds like you want something like

[!is[system]!tag[$:/tags/Stylesheet]!tag[$:/tags/Macro]sort[title]] [[Program Tips]] +[putfirst[]] [[In conclusion]]

To put an item in last place, all you have to do is list it at the end. Extra filter expressions dominantly append. So if an item shows up twice, it'll take the last one. Thus [[In conclusion]] will now be the last. There's no need to do any [putlast[]] stuff (which is designed to put the first listItem last).

Though this assumes [[In conclusion]] (or whatever you use) exists. If there's a chance it doesn't, then end with [[In conclusion]is[tiddler]] instead, which just prevents the filter from appending a non-existent title.

-Flibbles

Suzanne McHale

unread,
Oct 5, 2019, 1:00:49 AM10/5/19
to TiddlyWiki
Hi, that did have the result I wanted, thanks! The expression is now: 
[!is[system]!tag[$:/tags/Stylesheet]!tag[$:/tags/Macro]!tag[$:/tags/SideBar]sort[title]] [[Program tips]] +[putfirst[]] [tags[]!is[system]sort[title]] [[contents]]

 - exclude some pages tagged with $:/tags/, then sort other tiddlers by title, but put the Home page at the top, then follow this with tags contents pages, then the contents page (which lists all tags with their contents - a sort of meta page) last (at the bottom of the single page). 

Flibbles

unread,
Oct 5, 2019, 8:40:40 AM10/5/19
to TiddlyWiki
Sounds good. Glad it works for you.

For my own amusement, I was actually curious if there'd be a way to filter out all system tagged tiddlers without having to specify $:/tags/Stylesheet, $:/tags/Macro, and any others you may use

[!is[system]] -[tags[]is[system]tagging[]] +[sort[title]] [[Program tips]] +[putfirst[]] [tags[]!is[system]sort[title]] [[contents]]

If what you already have works, then it works. I just did this mostly for my own amusement, and thought I'd share.

-Flibbles

@TiddlyTweeter

unread,
Oct 5, 2019, 9:09:07 AM10/5/19
to tiddl...@googlegroups.com
Ciao Flibbles & Suzanne

This is a really interesting thread! I learned a lot from it.

I think part of the problem many of us have is the SYNTAX of filters is both sophisticated and really difficult to master.

[!is[system]] -[tags[]is[system]tagging[]] +[sort[title]] [[Program tips]] +[putfirst[]] [tags[]!is[system]sort[title]] [[contents]]

Whilst I can see NOW, more or less, how that makes sense, a non-tech begginer would likely see that as difficult variant of Algebraic Lithuanian with Albanian Qualifiers (p.s. some of my best friends are Lithuanians; not so sure about the Albanians :-).

My point? I do wonder whether we might develop a click-interface to ease the creation/learning of filters.

Just thoughts
TT

Suzanne McHale

unread,
Oct 5, 2019, 6:00:34 PM10/5/19
to TiddlyWiki
Hi, yes that shorter version you posted works, so I will use that - less to type, thanks!

Suzanne McHale

unread,
Oct 5, 2019, 6:02:44 PM10/5/19
to TiddlyWiki
Agreed, it is not beginner friendly - I do have a little familiarity with RegEx, so I wasn't trying it as a complete beginner, but I obviously still needed help figuring out the expression I wanted! (The documentation at the TiddlyWiki site is not easy to figure out.)

TonyM

unread,
Oct 6, 2019, 8:17:21 PM10/6/19
to TiddlyWiki
Suzanne,

We must also keep in mind that filters are definitely not simple when trying to do complex things. The point being they are very powerful and with power comes the need to understand and harness the power. Whilst it may seem a long journey to some, I would like to ensure them that this is a journey anyone needs to take if they learn how to juggle and manipulate filters they are developing reusable logic skills.

The Documentation is community driven. If you edit a tiddler at tiddlywiki.com you can submit changes via github. We value those who learn this method and contribute. And yes there are gaps (many are being addressed). Some others will help submit a change on your behalf (like me) if you give them the content.

I believe, one of our community responsibilities as beneficiaries of tiddlywiki's free software is to contribute back. One of the most useful is people learning tiddlywiki contributing to the documentation to easy the conceptual leaps needed during the learning process. I admit I struggled with Tw5 for some time, coming form TWC. But as my experience and expertise grows I am more and more distant from my original experiences. I try and remember my innocent past but it gets harder and harder.

One thing I wish I was given when I started has being published by me here - perhaps it will help?


Regards
Tony
Reply all
Reply to author
Forward
0 new messages