[tw5] Prevent an empty line

{{!!FieldName1}} {{!!FieldName2}} {{!!FieldName3}}

shows the values from these fields on one line.

{{!!Fieldname1}}

{{!!Fieldname2}}

{{!!Fieldname3}}

Displays the values of these fields among eachother. But if the field {{!!FieldName2}} contains no value, a blank line will be displayed.

\define listField(prefix:"")
<$list filter="[fields[]prefix[$prefix$]sort[title]]" variable=“fieldName”>
<$view field=<>/>
</$list>
\end
\define listFieldBR(prefix:"")
<$list filter="[fields[]prefix[$prefix$]sort[title]]" variable=“fieldName”>
<$view field=<>/>

</$list>
\end

<<listField"A">> <<listFieldBR"A">>
<<listFieldBR"B">>
<<listFieldBR"B">>
<<listFieldBR"B">>
<<listFieldBR"B">>
<<listField"C">>

Is also not working.

How can I prevent an empty line if there is no value, and still ensure that values are displayed behind or below each other?

First, a note that the active community is now at talk.tiddlwiki.org.

You won’t need any special definitions to get what you want — it’s all in basic wikitext.

See a working illustration here: Quick demo — showcasing…

The core of the solution looks like this (substitute prefix[b] for whatever you need):

<$list filter="[<currentTiddler>fields[]prefix[b]]" variable="fieldname">

''<<fieldname>>'': <$text text={{{ [get<fieldname>] }}}/>

</$list>