What I really would like to do is something like this:
<ul>
<$list filter="[<currentTiddler>fields[]prefix[FIELDNAME]]" variable="thisfield">
<li><$transclude field=<<thisfield>>/>
\variable 2
\variable 3
\variable 4 - also, one of these needs to be a link.
</li>
</$list>
</ul>
What I really would like to do is something like this:
<ul>
<$list filter="[<currentTiddler>fields[]prefix[FIELDNAME]]" variable="thisfield">
<li><$transclude field=<<thisfield>>/>
\variable 2
\variable 3
\variable 4 - also, one of these needs to be a link.
Where should these variables come from? You can use $set, $let widget outside the UL or $list element
-m
This is a case where it would be helpful to know why you’re doing what you’re doing.
You’re currently using a prefix of a field to turn into a variable which then gets used to find a field value. But you could just extract the field directly:
As I wrote in the other post. Wikitext is no general purpose programming language. In wikitext variables are only accessible “inside” a widget “body”. So eg:
<$let var1=test>
<!-- this is the widget body of the let-widget -->
value of var1: <<var1>>
</let>
outside value of var1: <<var1>> <-- there is no var1 any more ... It's gone
So even if you try to nest the list-widget, it won’t work that way, since your variables are only useful in the inside of the most inner list. … BUT every “outer” list is still active.
So if your variable1 has eg: 2 elements all the inner list will be evaluated 2 times. … That’s what you see.
As I also wrote, in the other post. I don’t see the whole picture, so I could only help with the topic that you described. … But I kind of knew, what could happen. …
We can only help, with problems we know, if they are described in plain text. If we understand the problem we can probably tell you, how to do it the “TiddlyWiki way”. …
The TW UI is mainly created using lists. They are everywhere. … But it’s important to understand that you can’t run a list-widget to create several variables. … You can use list-widgets to iterate over arrays of titles.
It’s like a “map()” function in other languages.
I don’t know, if that helps. … But without the “big picture” we can’t do much.
There is a typo in the example above: the end-let needs to look like </$let>
<$let var1=test>
<!-- this is the widget body of the let-widget -->
value of var1: <<var1>>
</$let>
outside value of var1: <<var1>> <-- there is no var1 any more ... It's gone
-m
PS: You should post at talk.tiddlywiki.org … We can edit posts there, to be sure examples work