Hi. I have this code, where I add the content of an illustration field to the background of an element via CSS. Sometimes a tiddler has content in its illustration field, and sometimes it doesn’t. I’m wondering what the best way might be to omit the “background-image: url()” attribute in the below if there is no illustration for a tiddler. Am I able to test a macro parameter for length/existence?
\define mydiv(illustration tsize subtag)
<div style='background-image:url($illustration$)' class='tagging $tsize$ $subtag$'>
<div><span class='condensed'><$link to={{!!title}}><$view field="title"/><br /><$view format="date" template="MM/DD/YY" field="created"/></$link></span></div></div>
\end
<$list filter="[all[current]tagging[]count[]!match[0]]" variable='moo'>
<div class='tagging-flex-container'>
<$list filter="[all[current]tagging[]!sort[created]]">
<$set name='tagstate' filter="[all[current]tagging[]count[]!match[0]]" value="subtag" emptyValue="no-subtag">
<$macrocall $name=mydiv illustration={{!!illustration}} tsize={{$:/jenn/templatesView/tagging!!tsize}} subtag=<<tagstate>>/>
</$set>
</$list>
</div>
</$list>