Hi Martin,
Welcome to Tiddlywiki!
In order to explain this, we should examine the {{tiddlerName!!field}}
syntax. This "wiki syntax" is actually shorthand for two Widgets. Widgets
in tiddlywiki are HTML-like entities that you can use to render content,
change tiddler/field value, etc. The shorthand is expanded to the
equivalent of:
<$tiddler tiddler="tiddlerName">
<$transclude field="field" />
</$tiddler>
The tool you want to use for this is the "List Widget". To use the List
Widget, you also need to understand "Filters".
https://tiddlywiki.com/#Widgets
https://tiddlywiki.com/#ListWidget
https://tiddlywiki.com/#Filters
We wrap the List Widget in a Tiddler Widget to set the "currentTiddler"
context variable explicitly. Then, by passing the List Widget a value for
the "variable" attribute we tell it not to overwrite the "currentTiddler"
variable. There are a few ways to construct the Filter for the List widget.
We can use the Range Operator to generate a range of numbers, or we can use
the Fields Operator to get all fields from the "currentTiddler". If the
tiddler only has numbered fields with source-text then that would be easier
to sort.
Then, as we cannot pass the variable syntax ( <<name>> ) through the
transclude shorthand syntax (i.e. "{{name!!<<field>>}}" DOES NOT WORK), we
need to call either the View or Transclude widget directly.
<$tiddler tiddler="John 3">
<$list variable="line" filter="[<currentTiddler>fields[]sort[]]">
<$transclude field=<<line>> />
<$/list>
</$tiddler>
I hope that helps!
Best,
Joshua Fontany
On Wednesday, February 12, 2020 at 9:05:52 AM UTC-8, Martin Pusch wrote:
>
> Hello, I have searched the discussions for a hint, but I still haven't
> managed to resolve my problem:
>
> Example: I have a tiddler, with the title: "John 3". The text is empty,
> but there are fields:
> Field name / Field content: 1 / There was a man of the Pharisees …
> Field name / Field content: 2 / The same came to Jesus by night …
> Field name / Field content: 3 / Jesus answered and said unto him …
> Field name / Field content: 4 / Nicodemus saith unto him, How can …
> Field name / Field content: 5 / Jesus answered, Verily, verily, I say unto
> thee …
>
> Now, I can use this structure to transclude verses out of the fields in
> another tiddler, typing:
>
> {{John 3!!1}} – and this statement will be replaced by the string "There
> was a man of the Pharisees …"
>
> Like this, I don't need to rewrite text that is allready written.
>
> My problem: How can I get several fields in a row? I want to be able to
> write something like:
>
> {{John 3!!1-5}} – and get the content of the fields 1 … 5.
>
> I think I need to write a macro to get what I want. But how can I address
> a series of fields? Is there something like a "FOR I = 1 to 5" like in
> Basic?
>
> Can anybody give me a hint please?
>
>
>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywikidev/8b6a0759-acff-4fed-9e19-0a568264a157%40googlegroups.com.