[tw5] Nested Lists, I think I am missing something.

I am able to list the Fields of a Tiddler when on it using this;

<$list filter="[all[current]fields[]sort[title]] -text" variable=“listItem”>
<> = <$view field=<>/>

</$list>

I am trying to wrap it inside another list such that it does not work with the current tiddler, but instead those in the first list. I know I need to change that filter, but cannot for the life of me work out how. I would definitely want to do it as a nested list because I need to group the fields.

My Simple List currently is just <$list filter="[tag[Chapter]]+[sort[]]"> otherListGoesHere </$list>

I even foolishly tried asking ChatGPT, but its grasp of TiddlyWiki is even worse than mine!

For me this code worked well

\define showFields()
<$list filter="[all[current]fields[]sort[title]] -text" variable="listItem">
<<listItem>> = <$view field=<<listItem>>/><br>
</$list>
\end

<$list filter="[tag[Chapter]]+[sort[]]">
<<showFields>>
<hr>
</$list>

Instead of using a macro you could also copy your initial code into the outer list.

Thanks! That works!