In a chunk I have this code:
[tt]
<h2>[+title+]</h2>
<p><a href="[~[+id+]~]">[+template_img+]</a></p>
<p class="se_html"><a onclick="window.open(this.href); return false;"href="[+html+]">se som HTML </a></p>
[/tt]
.... the last line ....href="[+html+]">se som HTML </a> give me some problems ..... sometimes there are no data in the [+html+] and then I like to hide the link ...... how do I do that?
Snippet (call it ShowLink):
(untested code)
[!ShowLink? &hLink=`[+myHtml+]` !]
Snippet Code (untested):
<?php
if (empty($myHtml)) {
$output = '';
} else {
$ouput = '<p class="se_html"><a onclick="window.open(this.href); return false;"href="' . $myHtml . '>se som HTML </a></p>';
}
return $output;
?>
BTW, I would not use html as a placeholder name.