Prevent an empty line

36 views
Skip to first unread message

vinvi...@gmail.com

unread,
Mar 23, 2024, 11:45:59 AMMar 23
to TiddlyWiki
{{!!FieldName1}} {{!!FieldName2}} {{!!FieldName3}}

shows the values from these fields on one line.

{{!!Fieldname1}} <br>
{{!!Fieldname2}} <br>
{{!!Fieldname3}} <br>

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=<<fieldName>>/>
</$list>
\end
\define listFieldBR(prefix:"")
<$list filter="[fields[]prefix[$prefix$]sort[title]]" variable="fieldName">
 <$view field=<<fieldName>>/><br>
</$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?

springer

unread,
Mar 25, 2024, 11:25:00 AMMar 25
to TiddlyWiki
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.


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>

```
Reply all
Reply to author
Forward
0 new messages