Reveal content of a field in a list

Hi there,

I’m trying to show a date (content of a field) in a nested list.

The list is build out of nested tags:

<$list filter="[tag[Projekt]">
''<$link to={{!!title}}><$view field="title"/></$link>''<br>
<$list filter="[is[current]tagging[]tag[task]">
<$link to={{!!title}}>''<$view field="title"/>''</$link><br>
</$list>
</$list>

Some of the tasks have a field “date_fin”, if this field exists (and is not empty) I want the date to appear behind the title of the task in the list.

To do so, I have created a template called “t_date_fin” with the following content:

<$reveal type="nomatch" state={{!!title!!date_fin}} text=""> {{!!date_fin}}</$reveal>

and added a {{||t_date_fin}} following the link of the task - and it does not work out- :frowning:

“dangerous half-knowledge” as we say in german … :wink:

Could anyone give me a hint?

Just a hint. I have not tested your syntax. However shouldn’t the state parameter, in the reveal, be “default”. You want to compare text with default, not state. Hope this helps.

Craig

You have a lot of extra code that can be reduced, try out the following and see if it works for you:

<dl>
<$list filter="[tag[Projekt]]">
   <dt><$link>''{{!!title}}''</$link></dt>
   <$list filter="[<currentTiddler>tagging[]tag[task]]">
      <dd><$link /> <$text text={{{ [<currentTiddler>has[date_fin]get[date_fin]] }}} /></dd>
   </$list>
</$list>
</dl>

Try this:

<$list filter="[tag[Projekt]]">
   <$link/><br/>
   <$list filter="[<currentTiddler>tagging[]tag[task]]">
      &emsp; <$link/> {{!!date_fin}}<br/>
   </$list>
</$list>

Notes:

  • <$link/> defaults to using the <<currentTiddler>> (or {{!!title}}) value for the link and the text, and is equivalent to
    <$link to={{!!title}}><$view field="title"/></$link>

  • I used the simplest HTML formatting: &emsp; for indenting, and <br> for newlines.

  • There is no need to check for a value in {{!!date_fin}}. If the field doesn’t exist or has a blank value, nothing gets displayed.

enjoy,
-e

Thx, as I read your suggested code I understand it - but it’s not the way I could come near by myself, so I will stick with mine. :wink:

Thx!

Especially this remark is an eye-opener! :grin:

That’s nice, because it’s shorter. But somehow I’m not able to decorate this link, underscore works, bold not …