Hi everyone
After the recent update to my Subsume plugin, I got a hankerin’ for more.
All I need to make it work is a way to check to see if a macro parameter has text, and use it as the summary of the details element; if the parameter is empty, then it should use the tiddler title as the summary.
Below is what I have so far:
\define viewme(note:"" tid:"")<details><summary>$note$ <$button class="tc-btn-invisible"><$action-sendmessage $message="tm-edit-tiddler" $param="$tid$" /> ^^{{$:/core/images/edit-button}}^^ </$button></summary><span class="indent1"><$transclude tiddler="$tid$" mode="block"/></span></details>
$tid$ is the tiddler transcluded in the details element, and $note$ is the text that gets displayed to the details summary. <<viewme note:"foo" tid:"bar">>
results in the equivalent of this:
<details><summary>foo [button to edit bar]</summary>
{{bar}}
</details>
But I can see cases in which I would like to write <<viewme note:"" tid:"bar">>
and have the output be
<details><summary>bar [button to edit bar]</summary>
{{bar}}
</details>
So is there a way to have it grab $note$ if there is something there, but if not, grab $tid$ instead?