Web Clipper template: delete line if variable has no value?

I want to set up:

![]({{image}})

in such a way that outputs an empty line if {{image}} has no value (i.e. the web clipper didn’t find an image), and outputs:

![]({{image}})

if {{image}} has value (i.e. the web clipper has found an image).

I almost have this going with:

{{image|map:img => img ? `![](${img})` : ""|join:""}}

With this:

{{image}} has no value → No output (line is empty–what I want)

{{image}} has value → Outputs bare URL (missing the ![]())

Is what I want possible? :thinking:

Ah, the solution was actually much simpler! I overthought this. All I needed was {{image|image}} .

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.