How to dereference caption field?

A caption field might contain a reference to another tiddler (e.g. {{$:/stuff/mycaption}} ) or it might contain just text. What is the easiest way to render the text, regardless of which situation applies?

Thanks!

1 Like

Hi @Mark_S

Did you try a transclude widget?
Like this:

<$transclude $tiddler=<<currentTiddler>> $field="caption" />

Fred

1 Like

Thanks Fred! That seems to do it.

2 Likes

Hi,

{{!!caption}}

will also work, M

In the context of the view widget, it didn’t work for me

<$view field={{!!caption}} />

But as so often happens, this was all in the context of a particular tool set, and I’ve already moved on from it to another.

I am not sure, if that’s what you intended. {{!!caption}} this transclusion reads the content of the caption field and assigns it to the field-parameter. So if the caption value asdfasdf – There needs to be a field with the same name. – I am pretty sure, that’s not what is intended.

You are right. I was working from memory.

It was

<$view field="caption"/>