Converting JSP scriptlet to Adobe Sightly/HTL?
<p>I've the following scriptlet in JSP adobe Cq5 and now migrating to Adobe Sightly/HTL.
Have the following code, which will open a new window upon clicking on anchor link, same functionality has to be written in sightly. Can you pls help me here?</p>

<hr>

<pre><code>     &lt;% if(!properties.get("buttonlabel","").equals("")){
            String targetUrl ="#";
             targetUrl = properties.get("buttonurl","#");
                    if(targetUrl.startsWith("/content")){
                        targetUrl = targetUrl+".html";
                    }
        String target = "_self";

        if(currentNode.hasProperty("openWindow")){
                    target = "_blank";
                }



    %&gt;
    &lt;!--
    &lt;div class="fcdetails-button-holder"&gt;
                            &lt;a href='&lt;%=targetUrl%&gt;' target ='&lt;%=target%&gt;' name='&lt;%=properties.get("buttonlabel","Title")%&gt; button' id="wp-ctoa_button" class="button" role="button"&gt;&lt;%=properties.get("buttonlabel","Title")%&gt;&lt;/a&gt;
                        &lt;/div&gt;
    --&gt;

        &lt;div class="fcdetails-button-holder"&gt;
        &lt;button type="button" id="wp-ctoa_button" class="button" onclick="redirect()"&gt;&lt;%=properties.get("buttonlabel","Title")%&gt;&lt;/button&gt;
        &lt;/div&gt;
        &lt;script type="text/javascript"&gt;
            function redirect()
            {
                var url = "&lt;%=targetUrl%&gt;";
                window.open(url,"&lt;%=target%&gt;");
            }
        &lt;/script&gt;
</code></pre>