{"id":1766,"date":"2017-05-25T06:42:12","date_gmt":"2017-05-25T06:42:12","guid":{"rendered":"https:\/\/www.botreetechnologies.com\/blog\/?p=1766"},"modified":"2021-09-08T18:53:18","modified_gmt":"2021-09-08T13:23:18","slug":"exploring-handlebars-js-features","status":"publish","type":"post","link":"https:\/\/www.botreetechnologies.com\/blog\/exploring-handlebars-js-features\/","title":{"rendered":"Exploring Handlebars JS features!"},"content":{"rendered":"\n<p>In my\u00a0<a href=\"https:\/\/www.botreetechnologies.com\/blog\/using-handlebars-js-with-ruby-on-rails\/\" target=\"_blank\" rel=\"noreferrer noopener\">previous post<\/a>\u00a0I explained what is\u00a0<a href=\"http:\/\/handlebarsjs.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Handlebars JS<\/a>\u00a0and how we can use it with\u00a0<a href=\"https:\/\/www.botreetechnologies.com\/ruby-on-rails-development\" target=\"_blank\" rel=\"noreferrer noopener\">Ruby on Rails<\/a>. In this article lets look at some of the useful helpers provided out of the box by Handlebars, how we can add custom helpers and also how we can create reusable partials.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"300\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/Getting-started.jpeg\" alt=\"Getting started\" class=\"wp-image-14514\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/Getting-started.jpeg 400w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/Getting-started-300x225.jpeg 300w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><figcaption>Let&#8217;s Start<\/figcaption><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Conditional execution using if&nbsp;block<\/h3>\n\n\n\n<p>If we want conditional rendering of the block we can use&nbsp;<code>if<\/code><b>block helper<\/b>. This block will not be executed by if the condition evaluates to&nbsp;<code>false<\/code>,&nbsp;<code>undefined<\/code>,&nbsp;<code>null<\/code>,&nbsp;<code>\"\"<\/code>,&nbsp;<code>0<\/code>, or&nbsp;<code>[]<\/code>&nbsp;. Block will only be executed if condition is anything but false.<\/p>\n\n\n\n<p>Let&#8217;s have a look at the code below.<\/p>\n\n\n\n<p><script src=\"https:\/\/gist.github.com\/AnkurVyas-BTC\/5ecf5b97d5452937dfdc550af67a043b.js\"><\/script><\/p>\n\n\n\n<p>In above code we have&nbsp;<code>if<\/code>&nbsp;block starting from&nbsp;<a href=\"https:\/\/gist.github.com\/AnkurVyas-BTC\/5ecf5b97d5452937dfdc550af67a043b#file-handlebars_helpers-hbs-L2\" target=\"_blank\" rel=\"noopener noreferrer\">line#2<\/a>&nbsp;to&nbsp;<a href=\"https:\/\/gist.github.com\/AnkurVyas-BTC\/5ecf5b97d5452937dfdc550af67a043b#file-handlebars_helpers-hbs-L12\" target=\"_blank\" rel=\"noopener noreferrer\">line#12<\/a>, this entire block will not be executed if we don&#8217;t pass price of any book.<\/p>\n\n\n\n<p><script src=\"https:\/\/gist.github.com\/AnkurVyas-BTC\/a2d9f39de29134380747b383464ceeb7.js\"><\/script><\/p>\n\n\n\n<p>If we pass above JSON data like<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">HandlebarsTemplates['book_list']({ books: data});<\/pre>\n\n\n\n<p>then the book with the name&nbsp;<code>JQuery<\/code>&nbsp;will not be printed as the price is&nbsp;<code>0<\/code> <b>(<code>0<\/code> is considered as false)<\/b>. So here it will check&nbsp;<code>if 0<\/code>&nbsp;which will evaluates to&nbsp;<i>false<\/i>. So the books with the name&nbsp;<code>Javascript<\/code>&nbsp;and&nbsp;<code>Ruby<\/code>&nbsp;will only be printed.<\/p>\n\n\n\n<p>Similarly you can also use&nbsp;<code>unless<\/code>&nbsp;which is exactly the opposite of&nbsp;<code>if<\/code>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Creating custom&nbsp;helpers<\/h4>\n\n\n\n<p>Handlebars also provide the facility to create our own\u00a0<b>custom helper<\/b> methods. This allows us to reuse the code logic as and helps us to achieve the\u00a0<a href=\"https:\/\/en.wikipedia.org\/wiki\/Don%27t_repeat_yourself\" target=\"_blank\" rel=\"noopener noreferrer\">Don&#8217;t Repeat Yourself (DRY)<\/a>\u00a0principle. You can use the\u00a0Handlebars API\u00a0for registering any helper using the\u00a0<code>registerHelper<\/code>\u00a0method.<\/p>\n\n\n\n<p><script src=\"https:\/\/gist.github.com\/AnkurVyas-BTC\/ccbc23a8a0c9be7caece7001ec981472.js\"><\/script><\/p>\n\n\n\n<p>Above code registers a helper named&nbsp;<code>formatName<\/code>&nbsp;and expects a parameter to it. It will return the string after prepending&nbsp;<code>Mr.<\/code>&nbsp;before the parameter which will be passed run-time.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;td&gt;{{formatName author}}&lt;\/td&gt;<\/pre>\n\n\n\n<p>So when the above line is executed it will print the following code.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;td&gt;Mr. Author-1&lt;\/td&gt;<\/pre>\n\n\n\n<p>The best part about it is code re-usability.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>A helper will surely help you to solve many problems&nbsp;\ud83d\ude09<\/p><\/blockquote>\n\n\n\n<h4 class=\"wp-block-heading\">Creating reusable&nbsp;partials<\/h4>\n\n\n\n<p>Partial is a html code which generally repeats itself and has the similar structure. If some html code is there in our code base that repeats itself then we can break it into small&nbsp;<b><i>partials<\/i><\/b>. We can always pass the variables to the partials to get the dynamic behaviour. They are pretty much similar to&nbsp;<a href=\"http:\/\/guides.rubyonrails.org\/layouts_and_rendering.html#using-partials\" target=\"_blank\" rel=\"noopener noreferrer\">rails partials<\/a>&nbsp;and arguments to partials are same as locals in rails partials.<\/p>\n\n\n\n<p><script src=\"https:\/\/gist.github.com\/AnkurVyas-BTC\/b3997b50840fbb3d7d5d700ad20a7333.js\"><\/script><\/p>\n\n\n\n<p>The above code registers a partial named&nbsp;<code>getButton<\/code>&nbsp;.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">{{&gt; getButton className=\"edit-book btn btn-warning\" text=\"Edit\"}}<\/pre>\n\n\n\n<p>In&nbsp;<a href=\"https:\/\/gist.github.com\/AnkurVyas-BTC\/5ecf5b97d5452937dfdc550af67a043b#file-handlebars_helpers-hbs-L8\" target=\"_blank\" rel=\"noopener noreferrer\">above line<\/a>&nbsp;we have used partial named&nbsp;<code>getButton<\/code>&nbsp;and passed two parameters to it&nbsp;<code>className<\/code>&nbsp;and&nbsp;<code>text<\/code>&nbsp;. One other thing worth noticing is that we need to use&nbsp;<code>{{&gt; }}<\/code>&nbsp;syntax to&nbsp;<b>invoke any partial<\/b>. When&nbsp;<code>getButton<\/code>&nbsp;partial is invoked it prints the following code.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;button class=\"edit-book btn btn-warning\" data-book-id=\"2\"&gt;\nEdit\n&lt;\/button&gt;<\/pre>\n\n\n\n<p>If you notice, we have passed the&nbsp;<code>className<\/code>&nbsp;and&nbsp;<code>text<\/code>&nbsp;as parameters and they are printed but from where this mysterious&nbsp;<code>id<\/code>&nbsp;comes from? Though not much mysterious&nbsp;!!!<\/p>\n\n\n\n<p>When any variable is invoked and if its not a local or global variable then Handlebars calls it from the context where it was invoked. So it takes id from the&nbsp;<a href=\"https:\/\/gist.github.com\/AnkurVyas-BTC\/a2d9f39de29134380747b383464ceeb7\" target=\"_blank\" rel=\"noopener noreferrer\">json that we passed<\/a>&nbsp;and prints&nbsp;<code>2<\/code>.<\/p>\n\n\n\n<p>So all in all our&nbsp;<a href=\"https:\/\/gist.github.com\/AnkurVyas-BTC\/5ecf5b97d5452937dfdc550af67a043b\" target=\"_blank\" rel=\"noopener noreferrer\">first piece of code<\/a>&nbsp;will give following result.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"276\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/Handlebars-using-custom-helpers-and-partials-1024x276.png\" alt=\"Handlebars using custom helpers and partials\" class=\"wp-image-14515\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/Handlebars-using-custom-helpers-and-partials-1024x276.png 1024w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/Handlebars-using-custom-helpers-and-partials-300x81.png 300w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/Handlebars-using-custom-helpers-and-partials-768x207.png 768w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/Handlebars-using-custom-helpers-and-partials-1200x324.png 1200w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/Handlebars-using-custom-helpers-and-partials.png 1204w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Handlebars using custom helpers and partials<\/figcaption><\/figure>\n\n\n\n<p>Handlebars JS also provide lots of interesting features that are worth noticing. You can find the whole documentation&nbsp;<a href=\"http:\/\/handlebarsjs.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p><i>At&nbsp;<a href=\"https:\/\/www.botreetechnologies.com\/\" target=\"_blank\" rel=\"noopener noreferrer\"><b>BoTree Technologies<\/b><\/a>, we build web and&nbsp;mobile applications&nbsp;to add value to our client\u2019s business. We align ourselves to ensure that our client benefits the most out of our engagement.<\/i><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><i><a href=\"https:\/\/www.botreetechnologies.com\/contact\" target=\"_blank\" rel=\"noopener noreferrer\">Drop us a line<\/a>&nbsp;to discuss how can we help take your business to the next level.<\/i><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my\u00a0previous post\u00a0I explained what is\u00a0Handlebars JS\u00a0and how we can&#8230;<\/p>\n","protected":false},"author":9,"featured_media":14513,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[73,10],"tags":[],"class_list":["post-1766","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ruby-on-rails","category-technology"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Exploring Handlebars JS features! - BoTree Technologies<\/title>\n<meta name=\"description\" content=\"Look at some of the useful helpers provided out of the box by Handlebars, how we can add custom helpers and also how we can create reusable partials.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.botreetechnologies.com\/blog\/exploring-handlebars-js-features\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Exploring Handlebars JS features! - BoTree Technologies\" \/>\n<meta property=\"og:description\" content=\"Look at some of the useful helpers provided out of the box by Handlebars, how we can add custom helpers and also how we can create reusable partials.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.botreetechnologies.com\/blog\/exploring-handlebars-js-features\/\" \/>\n<meta property=\"og:site_name\" content=\"BoTree Technologies\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/BoTreeTechnologies\/\" \/>\n<meta property=\"article:published_time\" content=\"2017-05-25T06:42:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-08T13:23:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2017\/05\/exploring-handlebars.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"852\" \/>\n\t<meta property=\"og:image:height\" content=\"479\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Ankur Vyas\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@BoTreeTech\" \/>\n<meta name=\"twitter:site\" content=\"@BoTreeTech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ankur Vyas\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/exploring-handlebars-js-features\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/exploring-handlebars-js-features\/\"},\"author\":{\"name\":\"Ankur Vyas\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/#\/schema\/person\/aa180b4d8d933949f15aba97d8d138a5\"},\"headline\":\"Exploring Handlebars JS features!\",\"datePublished\":\"2017-05-25T06:42:12+00:00\",\"dateModified\":\"2021-09-08T13:23:18+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/exploring-handlebars-js-features\/\"},\"wordCount\":637,\"commentCount\":1,\"image\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/exploring-handlebars-js-features\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2017\/05\/exploring-handlebars.jpg\",\"articleSection\":[\"Ruby on Rails\",\"Technology\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.botreetechnologies.com\/blog\/exploring-handlebars-js-features\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/exploring-handlebars-js-features\/\",\"url\":\"https:\/\/www.botreetechnologies.com\/blog\/exploring-handlebars-js-features\/\",\"name\":\"Exploring Handlebars JS features! - BoTree Technologies\",\"isPartOf\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/exploring-handlebars-js-features\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/exploring-handlebars-js-features\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2017\/05\/exploring-handlebars.jpg\",\"datePublished\":\"2017-05-25T06:42:12+00:00\",\"dateModified\":\"2021-09-08T13:23:18+00:00\",\"author\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/#\/schema\/person\/aa180b4d8d933949f15aba97d8d138a5\"},\"description\":\"Look at some of the useful helpers provided out of the box by Handlebars, how we can add custom helpers and also how we can create reusable partials.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/exploring-handlebars-js-features\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.botreetechnologies.com\/blog\/exploring-handlebars-js-features\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/exploring-handlebars-js-features\/#primaryimage\",\"url\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2017\/05\/exploring-handlebars.jpg\",\"contentUrl\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2017\/05\/exploring-handlebars.jpg\",\"width\":852,\"height\":479,\"caption\":\"Exploring Handlebars JS features!\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/exploring-handlebars-js-features\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.botreetechnologies.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Exploring Handlebars JS features!\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/#website\",\"url\":\"https:\/\/www.botreetechnologies.com\/blog\/\",\"name\":\"BoTree Technologies\",\"description\":\"Committed to inspire generation.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.botreetechnologies.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/#\/schema\/person\/aa180b4d8d933949f15aba97d8d138a5\",\"name\":\"Ankur Vyas\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/10\/ankur-vyas-1-150x150.png\",\"url\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/10\/ankur-vyas-1-150x150.png\",\"contentUrl\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/10\/ankur-vyas-1-150x150.png\",\"caption\":\"Ankur Vyas\"},\"description\":\"Ankur is a Ruby on Rails Developer and Practice Lead JavaScript. He loves Ruby, JavaScript, reading and writing blogs, problem-solving and taking ownership of work. Apart from coding he likes to listen to songs, gaming and traveling.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Exploring Handlebars JS features! - BoTree Technologies","description":"Look at some of the useful helpers provided out of the box by Handlebars, how we can add custom helpers and also how we can create reusable partials.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.botreetechnologies.com\/blog\/exploring-handlebars-js-features\/","og_locale":"en_US","og_type":"article","og_title":"Exploring Handlebars JS features! - BoTree Technologies","og_description":"Look at some of the useful helpers provided out of the box by Handlebars, how we can add custom helpers and also how we can create reusable partials.","og_url":"https:\/\/www.botreetechnologies.com\/blog\/exploring-handlebars-js-features\/","og_site_name":"BoTree Technologies","article_publisher":"https:\/\/www.facebook.com\/BoTreeTechnologies\/","article_published_time":"2017-05-25T06:42:12+00:00","article_modified_time":"2021-09-08T13:23:18+00:00","og_image":[{"width":852,"height":479,"url":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2017\/05\/exploring-handlebars.jpg","type":"image\/jpeg"}],"author":"Ankur Vyas","twitter_card":"summary_large_image","twitter_creator":"@BoTreeTech","twitter_site":"@BoTreeTech","twitter_misc":{"Written by":"Ankur Vyas","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.botreetechnologies.com\/blog\/exploring-handlebars-js-features\/#article","isPartOf":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/exploring-handlebars-js-features\/"},"author":{"name":"Ankur Vyas","@id":"https:\/\/www.botreetechnologies.com\/blog\/#\/schema\/person\/aa180b4d8d933949f15aba97d8d138a5"},"headline":"Exploring Handlebars JS features!","datePublished":"2017-05-25T06:42:12+00:00","dateModified":"2021-09-08T13:23:18+00:00","mainEntityOfPage":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/exploring-handlebars-js-features\/"},"wordCount":637,"commentCount":1,"image":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/exploring-handlebars-js-features\/#primaryimage"},"thumbnailUrl":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2017\/05\/exploring-handlebars.jpg","articleSection":["Ruby on Rails","Technology"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.botreetechnologies.com\/blog\/exploring-handlebars-js-features\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.botreetechnologies.com\/blog\/exploring-handlebars-js-features\/","url":"https:\/\/www.botreetechnologies.com\/blog\/exploring-handlebars-js-features\/","name":"Exploring Handlebars JS features! - BoTree Technologies","isPartOf":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/exploring-handlebars-js-features\/#primaryimage"},"image":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/exploring-handlebars-js-features\/#primaryimage"},"thumbnailUrl":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2017\/05\/exploring-handlebars.jpg","datePublished":"2017-05-25T06:42:12+00:00","dateModified":"2021-09-08T13:23:18+00:00","author":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/#\/schema\/person\/aa180b4d8d933949f15aba97d8d138a5"},"description":"Look at some of the useful helpers provided out of the box by Handlebars, how we can add custom helpers and also how we can create reusable partials.","breadcrumb":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/exploring-handlebars-js-features\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.botreetechnologies.com\/blog\/exploring-handlebars-js-features\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.botreetechnologies.com\/blog\/exploring-handlebars-js-features\/#primaryimage","url":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2017\/05\/exploring-handlebars.jpg","contentUrl":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2017\/05\/exploring-handlebars.jpg","width":852,"height":479,"caption":"Exploring Handlebars JS features!"},{"@type":"BreadcrumbList","@id":"https:\/\/www.botreetechnologies.com\/blog\/exploring-handlebars-js-features\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.botreetechnologies.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Exploring Handlebars JS features!"}]},{"@type":"WebSite","@id":"https:\/\/www.botreetechnologies.com\/blog\/#website","url":"https:\/\/www.botreetechnologies.com\/blog\/","name":"BoTree Technologies","description":"Committed to inspire generation.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.botreetechnologies.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.botreetechnologies.com\/blog\/#\/schema\/person\/aa180b4d8d933949f15aba97d8d138a5","name":"Ankur Vyas","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/10\/ankur-vyas-1-150x150.png","url":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/10\/ankur-vyas-1-150x150.png","contentUrl":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/10\/ankur-vyas-1-150x150.png","caption":"Ankur Vyas"},"description":"Ankur is a Ruby on Rails Developer and Practice Lead JavaScript. He loves Ruby, JavaScript, reading and writing blogs, problem-solving and taking ownership of work. Apart from coding he likes to listen to songs, gaming and traveling."}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/1766","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/comments?post=1766"}],"version-history":[{"count":2,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/1766\/revisions"}],"predecessor-version":[{"id":16247,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/1766\/revisions\/16247"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/media\/14513"}],"wp:attachment":[{"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/media?parent=1766"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/categories?post=1766"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/tags?post=1766"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}