<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Switching back to Handlebars (from jsrender) ?]]></title><description><![CDATA[<p>Hello,</p>
<p>As was advised by <a class="plugin-mentions-a" href="https://forum.jsreport.net/uid/2">@jan_blaha</a> I consider switching back to <code>Handlebars</code>. I am just discovering the jsreport product and Handlebars looks very annoying to work with. jsrender seemed more friendly. Maybe I did not understand the basics, this is why I am asking here. Here are the reasons of my initial switch from Handlbars to jsrender:</p>
<ol>
<li><code>jsrender</code> lets you do the tests directly inside the report like so : {{if someValue &gt;= 2}}print this{{else}}print that{{/if}}. It seems that Handlebars requires to write a function for every single test. Did I miss something?</li>
<li>it seems that jsrender lets you declare &quot;variables&quot; that you can use throughout the templates (with {{* someVar = 2}} ). Does Handlebars provide such a feature?</li>
<li>I like jsrender's <code>itemVar</code> feature that lets you define an alias rather than using the clumsy ../../../field. This is just comfort and readability so I can live without it.</li>
</ol>
<p>Thanks for you inputs.</p>
]]></description><link>https://forum.jsreport.net/topic/2559/switching-back-to-handlebars-from-jsrender</link><generator>RSS for Node</generator><lastBuildDate>Tue, 19 May 2026 03:45:01 GMT</lastBuildDate><atom:link href="https://forum.jsreport.net/topic/2559.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 06 Sep 2022 16:47:30 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Switching back to Handlebars (from jsrender) ? on Invalid Date]]></title><description><![CDATA[<p>Hello,</p>
<p>As was advised by <a class="plugin-mentions-a" href="https://forum.jsreport.net/uid/2">@jan_blaha</a> I consider switching back to <code>Handlebars</code>. I am just discovering the jsreport product and Handlebars looks very annoying to work with. jsrender seemed more friendly. Maybe I did not understand the basics, this is why I am asking here. Here are the reasons of my initial switch from Handlbars to jsrender:</p>
<ol>
<li><code>jsrender</code> lets you do the tests directly inside the report like so : {{if someValue &gt;= 2}}print this{{else}}print that{{/if}}. It seems that Handlebars requires to write a function for every single test. Did I miss something?</li>
<li>it seems that jsrender lets you declare &quot;variables&quot; that you can use throughout the templates (with {{* someVar = 2}} ). Does Handlebars provide such a feature?</li>
<li>I like jsrender's <code>itemVar</code> feature that lets you define an alias rather than using the clumsy ../../../field. This is just comfort and readability so I can live without it.</li>
</ol>
<p>Thanks for you inputs.</p>
]]></description><link>https://forum.jsreport.net/post/11113</link><guid isPermaLink="true">https://forum.jsreport.net/post/11113</guid><dc:creator><![CDATA[gosanefr]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Switching back to Handlebars (from jsrender) ? on Invalid Date]]></title><description><![CDATA[<p>I understand the concern and I used to prefer using jsrender as well.<br />
However, Handlebars is just much more popular so we had to target our focus primarily on that.  The Handlebars can be more chatty and less natural, but in the end you will reach your goals without big troubles.</p>
<p>Here are some answers to your questions, but you can typically find the answers quickly at StackOverflow or in the handlebars docs.</p>
<blockquote>
<p>jsrender lets you do the tests directly inside the report like so : {{if someValue &gt;= 2}}print this{{else}}print that{{/if}}. It seems that Handlebars requires to write a function for every single test. Did I miss something?</p>
</blockquote>
<p><a href="https://stackoverflow.com/questions/8853396/logical-operator-in-a-handlebars-js-if-conditional" rel="nofollow">https://stackoverflow.com/questions/8853396/logical-operator-in-a-handlebars-js-if-conditional</a></p>
<blockquote>
<p>it seems that jsrender lets you declare &quot;variables&quot; that you can use throughout the<br />
templates (with {{* someVar = 2}} ). Does Handlebars provide such a feature?</p>
</blockquote>
<p>You can use <code>with</code> helper, perhaps<br />
<a href="https://handlebarsjs.com/guide/builtin-helpers.html#with" rel="nofollow">https://handlebarsjs.com/guide/builtin-helpers.html#with</a><br />
<a href="https://playground.jsreport.net/w/anon/P4y_7rdV" rel="nofollow">https://playground.jsreport.net/w/anon/P4y_7rdV</a></p>
<blockquote>
<p>I like jsrender's itemVar feature that lets you define an alias rather than using the clumsy ../../../field. This is just comfort and readability so I can live without it.</p>
</blockquote>
<p>This can be done with bloc parameters<br />
<a href="https://handlebarsjs.com/guide/block-helpers.html#block-parameters" rel="nofollow">https://handlebarsjs.com/guide/block-helpers.html#block-parameters</a></p>
]]></description><link>https://forum.jsreport.net/post/11114</link><guid isPermaLink="true">https://forum.jsreport.net/post/11114</guid><dc:creator><![CDATA[jan_blaha]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>