Inverted list

85 views
Skip to first unread message

Peter Buyze

unread,
May 1, 2020, 12:06:57 PM5/1/20
to TiddlyWiki forum
I have a collection of tiddlers, some of which have a field with an alphanumeric number, some have that field empty. Right now I have a list that collects the numbers and the corresponding tiddler titles below each number. This is the script/macro:

<$list filter="[all[tiddlers]each[number]sortan[number]get[number]]" variable=value >
__<<value>>__<br>
<$list filter='[all[tiddlers]number<value>sort[]]'>

</$list>
</$list>

What I would like is the inverse: I want the tiddler titles (sorted alphabetically) and the numbers for each below. I don't want to see tiddlers which have an empty number field. So, I tried this:

<div class="tc-table-of-contents">
    <<toc-selective-expandable "title" sort[]>>
    </div>
<$list filter="[all[tiddlers]each[number]sortan[number]get[number]]" variable=value >
__<<value>>__<br>
<$list filter='[all[tiddlers]number<value>sort[]]'>

</$list>
</$list>

But that does not do it, in fact the toc section is ignored. What am I doing wrong?


--
Securely sent with Tutanota. Get your own encrypted, ad-free mailbox:

Mark S.

unread,
May 1, 2020, 12:46:01 PM5/1/20
to TiddlyWiki
So you want

  Tiddler A: 25
  Tiddler B: 16
  Tiddler C: 28

but Tiddler D not shown because it has no number field ? The part that's throwing me is the requirement "the numbers for each below". Since each tiddler has only one number field, there is no sub-sort possible and you only have to list the tiddlers that have a number field and display their title and number field. But that seems too easy, so there must be a part that I'm missing.

Peter Buyze

unread,
May 2, 2020, 12:21:45 AM5/2/20
to 'Mark S.' via TiddlyWiki
Mark S.

Tiddler A: n25, n107
Tiddler B: n73
Tiddler C: n3, n208
Tiddler D: not shown because the field is empty

When I say "the numbers for each below", that's how the current output is:
n25
Tiddler A
Tiddler E

n107
Tiddler A

n73
Tiddler B


--
Securely sent with Tutanota. Get your own encrypted, ad-free mailbox:


1 May 2020, 19:46 by tiddl...@googlegroups.com:
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.

Mat

unread,
May 2, 2020, 6:32:07 AM5/2/20
to TiddlyWiki
@Peter - just put up a http://tiddlywiki5.tiddlyspot.com/ with sample tiddlers and code and a hard coded tiddler showing the desired output. That makes it MUCH easier for anyone to help you. Otherwise you only get hypothetical/untested answers that "ought to work". Without a wiki you've made, there is also a BIG risk you're unintentionally misleading the very people trying to help you because you expressed something ambiguously. It is off-putting to help someone where there's an overhanging risk of working with the wrong problem.

<:-)

Peter Buyze

unread,
May 2, 2020, 7:03:44 AM5/2/20
to TiddlyWiki forum
I have put up 3 tids ("commercial art", "do what you love to do", "prestige"), which show the number field in the Edit mode - see http://peterspottiddly.tiddlyspot.com/.

As for a "hard coded tiddler showing the desired output", I don't know what you mean by that: if I could produce the desired output I would not have asked the question in the 1st place. I probably misunderstand what you mean. Please bear in mind I am not conversant with HTML details, sorry.

The desired output is in my reply to Mark S.


2 May 2020, 13:32 by matia...@gmail.com:
@Peter - just put up a http://tiddlywiki5.tiddlyspot.com/ with sample tiddlers and code and a hard coded tiddler showing the desired output. That makes it MUCH easier for anyone to help you. Otherwise you only get hypothetical/untested answers that "ought to work". Without a wiki you've made, there is also a BIG risk you're unintentionally misleading the very people trying to help you because you expressed something ambiguously. It is off-putting to help someone where there's an overhanging risk of working with the wrong problem.

<:-)


--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.

Mat

unread,
May 2, 2020, 7:52:43 AM5/2/20
to TiddlyWiki
Peter Buyze wrote:
I have put up 3 tids ("commercial art", "do what you love to do", "prestige"), which show the number field in the Edit mode - see http://peterspottiddly.tiddlyspot.com/.

As for a "hard coded tiddler showing the desired output", I don't know what you mean by that:

"Hard coded" just means you type it explicitly. I.e, in this case to type out your desired "list" so it is obvious for me what the output from the code should be. What you wrote to doesn't contain the words "commercial art", "prestige" etc so that is an uncertainty someone helping you shouldn't have to deal with. Also in your message to mark you write "Tiddler A: n25, n107" but in your wiki I don't see any tiddlers that have two numbers so it is unclear if that means a field with 

number: n25, n107

or if somehow n25 and n107 are fetched from different places.
And what does this mean:

Tiddler D: not shown because the field is empty

- should Tiddler D not be seen at all or should the number not be seen? To me it seems reasonalbe that it is the number that shouldn't be seen... but it can't because it doesn't exist, so then you must mean the title Tiddler D shouldn't be seen, but then why is it written into the very list and not merely commented on afterwards?

So, my point is that if you ask for a question, it is reasonable to put a lot of work on phrasing it carefully possible because otherwise the burden is put on the people trying to help you. (I hope it is clear I'm not being rude here - I'm giving you my time merely to be kind, just like Mark)

Anyway, here's a start. Please specify in what way the output is not correct, if it is not. (For one thing, you mention a ToC in your OP - is that relevant?)

<$list filter="[tag[ToC-zettels]sort[]]">
   <$link/>:
   <$list filter="[all[current]get[number]]">
      <$view field=title/>
   </$list>
   
<br>
</$list>


<:-)

Peter Buyze

unread,
May 2, 2020, 8:50:54 AM5/2/20
to 'Peter Buyze' via TiddlyWiki
Mat, thanks for your help.
The numbers I quoted to Mark were fictitious examples, my tiddlers on Tiddylyspot are real ones I use. I did not think that would be confusing.

Your list filter is fine insofar as it lists all my tiddlers, and, where available, the alphanumeric numbers with them. Nevertheless, it also lists the tiddlers where the number field is empty, i.e. without a value. I don't want to see those.

So, in the 3 tiddlers shown in Tiddlyspot, I have deleted the alphanumeric number in the one called "commercial art", so in the filered list I would not want to see "commercial art".



2 May 2020, 14:03 by tiddl...@googlegroups.com:
I have put up 3 tids ("commercial art", "do what you love to do", "prestige"), which show the number field in the Edit mode - see http://peterspottiddly.tiddlyspot.com/.

As for a "hard coded tiddler showing the desired output", I don't know what you mean by that: if I could produce the desired output I would not have asked the question in the 1st place. I probably misunderstand what you mean. Please bear in mind I am not conversant with HTML details, sorry.

The desired output is in my reply to Mark S.


2 May 2020, 13:32 by matia...@gmail.com:
@Peter - just put up a http://tiddlywiki5.tiddlyspot.com/ with sample tiddlers and code and a hard coded tiddler showing the desired output. That makes it MUCH easier for anyone to help you. Otherwise you only get hypothetical/untested answers that "ought to work". Without a wiki you've made, there is also a BIG risk you're unintentionally misleading the very people trying to help you because you expressed something ambiguously. It is off-putting to help someone where there's an overhanging risk of working with the wrong problem.

<:-)


--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.


--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.

Mat

unread,
May 2, 2020, 8:56:16 AM5/2/20
to TiddlyWiki
OK, try this

<$list filter="[tag[ToC-zettels]has[number]sort[]]">

   <$link/>:
   <$list filter="[all[current]get[number]]">
      <$view field=title/>
   </$list>
   
<br>
</$list>

<:-)

Peter Buyze

unread,
May 2, 2020, 8:58:04 AM5/2/20
to TiddlyWiki forum
Yes, that's fine Mat. Many thanks.


2 May 2020, 15:56 by matia...@gmail.com:
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages