Eric,
Thanks again for your clear explanation and patience!
1. Transclude instead of view - of course, makes sense.
2. I did see the sort option, but couldn't figure out what should go in the
brackets. Then you showed me that nothing goes in the brackets - the only
available sorts are alphabetical, or reverse. So I renamed my indexes to
have numbers, so they sort alphabetically how I want them: jn_01_company,
jn_02 etc
3. Aha! I wasn't aware of the limit operator. Clever solution.
My table now shows what I want, and I easily add more rows, and create that
macro if I want.
I was also able to use edit-text widgets to be able to edit the values
directly.
Thanks again, you're most kind.
Best regards,
Matthew Petty
+971 56 622 1318
On Monday, March 28, 2016 at 6:12:57 PM UTC+4, Eric Shulman wrote:
>
> On Monday, March 28, 2016 at 3:17:51 AM UTC-7, Matthew Petty wrote:
>>
>> Eric,
>> That's great, thank you. Now I can have:
>> <table>
>> <$list filter="[prefix[Job Number:]]">
>> <tr><td>{{!!title}}</td><$list filter="[<currentTiddler>indexes[]]"
>> variable="thisIndex">
>> <td><$view index=<<thisIndex>>/></td>
>> </$list></tr></$list>
>> </table>
>> Which returns a nice table.
>>
>> There are still a couple of issues.
>> First, if the text reference contains a wiki link, like "[[Link]]", then
>> it is not returned as a link, but just as text with the square brackets. It
>> would be nice to be able to have that as a link if it wants to be, and to
>> ignore it if not.
>>
>
> Instead of the <$view> widget, use
> <$transclude index=<<thisIndex>>/>
>
> This will cause the value to be "translated" before it is "included" in
> the output (thus, "trans"+"clude"), so that any wiki syntax contained in
> the value will be processed (e.g., [[foo]] will become a proper link to a
> tiddler named "foo")
>
>
>> Secondly, how can I set the order of the index list? It seems to be
>> random at the moment. I'd like it to be in the order of the data in the
>> tiddler, or failing that, alphabetical.
>>
>
> As noted in the documentation for
> http://tiddlywiki.com/#indexes%20Operator, the names are returned "in no
> particular order". However, as with any filter result, you can apply a
> [sort[]] operator to change the order:
> <currentTiddler>indexes[]sort[]
>
> Thirdly, is it possible to return the names of the values, and not the
>> values themselves? If that were possible, the a macro could be made which
>> would do something like this:
>>
>
> The indexes[] operator IS already returning the names... not the values.
> The actual values are retrieved by the <$view> (or <$transclude>) widget.
> Assuming that all the "Job Number" tiddlers have the same index names,
> you can write your table like this:
>
> <table>
> <$list filter="[prefix[Job Number:]limit[1]]">
> <tr>
> <td> <!-- EMPTY CORNER --> </td>
> <$list filter="[<currentTiddler>indexes[]]" variable="thisIndex">
> <td><<thisIndex>></td>
> </$list>
> </tr>
> </$list>
> <$list filter="[prefix[Job Number:]]">
> <tr>
> <td>{{!!title}}</td>
> <$list filter="[<currentTiddler>indexes[]]" variable="thisIndex">
> <td><$view index=<<thisIndex>>/></td>
> </$list>
> </tr>
> </$list>
> </table>
>
> * The first $list widget retrieves ONE "Job Number" tiddler and uses it to
> display the headings (the index names). Note the use of "limit[1]" so that
> only one row of headings is shown.
> * The second $list widget then retrieves ALL "Job Number" tiddlers and
> displays a row for each tiddler, showing the index *values*.
>
> Q.E.D
>
> enjoy,
> -e
> Eric Shulman
> TiddlyTools / ELS Design Studios
> InsideTiddlyWiki: The Missing Manuals
>
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/652cad61-8aee-48d3-b1b8-11ad3e64bc28%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.