Templates
Helpers
basic helpers basic helpers are the helpers that you will use commenly in your templates underneath you will find all the possible helpers \#if you can use the if helper to conditionally render a block if its argument returns false , undefined , null , "" , 0 , or \[] , handlebars will not render the block when using a if helper , you can specify a template section to run if the expression returns a falsy value the section is marked by else {{#if production completed }} this film is completed {{else}} this film is still a work in progress {{/if}} \#unless you can use the unless helper as the inverse of the if helper its block will be rendered if the expression returns a falsy value {{#unless production completed }} this film is still a work in progress {{else}} this film is completed {{/unless}} \#with the with helper allows you to change the evaluation context of template part {{#with person}} dear {{firstname}} {{lastname}}, we look forward to meeting you at the festival {{/with}} list helpers use the list helpers to iterate over a list you can filter lists that contain elements with a key property inside the block, you can use this to reference the element being iterated over \#each you can iterate over a list using the each helper {{#each texts all }} {{#each texttranslations }} {{#compare language '==' 'en'}} {{ html }} {{/compare}} {{/each}} {{/each}} \#filter on key works the same as the each helper, but filter on key filters the list of elements on the property 'key' {{#filter on key credits all 'director' }} {{fullname}} {{/filter on key}} \#find on key this helper works the same as filter on key , but only returns the first matching element {{#find on key credits all 'director' }} {{fullname}} {{/find on key}} helpers for date comparison you can use date comparison helpers to conditionally render a block, based on a date these helpers are very useful to show todays screenings only, or future appointments \#before current date this helper returns elements (e g shows or appointments) before the current date shows in the past {{#each shows all }} {{#before current date starton}} {{/before current date }} {{/each}} \#before on current date this helper returns elements (e g shows or appointments) before or on the current date shows today and in the past {{#each shows all }} {{#before on current date starton}} {{/before on current date }} {{/each}} \#on current date this helper returns elements (e g shows or appointments) on a the current date your appointments today {{#each appointments all }} {{#on current date startson}} {{/on current date }} {{/each}} \#after current date this helper returns elements (e g shows or appointments) after the current date your upcoming appointments {{#each appointments all }} {{#after current date startson}} {{/after current date }} {{/each}} \#after on current date this helper returns elements (e g shows or appointments) after or on the current date your upcoming appointments {{#each appointments all }} {{#after on current date startson}} {{/after on current date }} {{/each}} \#on specific date this helper returns elements (e g shows or appointments) on a the specified date the date to compare with must be specified as a second argument using the format yyyy/mm/dd shows january 13th {{#each shows all }} {{#on specific date starton "2023/01/13"}} {{/on specific date }} {{/each}} helpers for creating program schedules fiona provides some helpers for creating visual program schedules you can use these helpers for positioning screening blocks based on their start times scaled time offset calculates an offset in pixels based on the difference between a start hour and an event date it can be used to calculate the 'absolute left' of an event on a schedule this helper needs three parameters datetime, fromhour, pixelsperhour the first parameter is the event starton datetime, the second parameter is the starting hour of the schedule (e g 10) and the third parameter is the number of pixels per hour {{#each shows all }} {{/each}} scaled time length calculates a width in pixels based on a start and end datetime it can be used to calculate the 'width' style of an event on a schedule the helper needs three parameters a start datetime, an end datetime and the number of pixels per hour can only be used at docid\ jhmrleg zuos36bkfjbja {{#each shows all }} {{/each}} other helpers format value formats a value according to a data format you can find formatting tips here docid\ yy7n2ejzkx2bulvarnidn info updated on {{format value metadata updatedon 'dd mm yy'}} br this helper converts line ends to \<br /> useful for formatting long texts {{br review }} \#compare you can use the compare helper to conditionally render a block, based on a comparison the first argument is the field to compare, the second argument is the operator for the comparison the third argument contains a fixed value to compare with you can combine compare with an else block for the operator, use "==" for equal to "!=" for not equal to ">" for greater than "<" for less than {{#each texts all }} {{#each texttranslations }} {{#compare language '==' 'en'}} {{ html }} {{/compare}} {{/each}} {{/each}} \#compare numbers use the compare numbers to compare two numbers with each other the first argument is the field to compare, the second argument is the operator for the comparison the third argument contains a fixed value to compare with you can combine compare numbers with an else block for the operator, use "==" for equal to ">" for greater than "<" for less than ">=" for less and equal to "<=" for greater and equal to {{#compare numbers general dueindays ">" 3}} your order is overdue by more than 3 days {{/compare numbers}} \#contains you can use the contains helper to conditionally render a block, based on a lookup of elements in a list this helper expects 4 arguments list of elements name of the propery of the element you like to test operator ("and" or "or") values to test against, comma separated {{ #contains production productioncountries "key" "and" "belgium,france" }} your film is produced in belgium and france {{ else }} {{ /contains }} {{ #contains production productioncountries "key" "or" "belgium,france" }} your film is produced in belgium or france {{ else }} {{ /contains }} \#contains not you can use the contains not helper to conditionally render a block, based on missing lookup of elements in a list this helper expects 4 arguments list of elements name of the propery of the element you like to test operator ("and" or "or") values to test against, comma separated {{ #contains not production productioncountries "key" "or" "belgium,france" }} your film isn't produced in either belgium or france {{ else }} {{ /contains }} special place holders documentadditionalnote you may want to add a personal note to a mailing, each time you send an email to an individual person if the documentadditionalnote place holder is added to a template, a text field appears when sending the mailing that way, you can add a personal note that replaces the placeholder please note {{documentadditionalnote}} documentcreatedon use this placeholder to add the date, the report / mailing has been printed / send out this document was printed on {{format value documentcreatedon 'd mmmm yyyy hh\ mm' }} documentcreatedby use this placeholder to add the name of the logged in user dear guest, kind regards {{documentcreatedby}} documentaddressedto the name of the recipient of the mailing dear {{documentaddressedto}}, kind regards {{documentcreatedby}} @index zero based index for the current iteration step set by the each helper {{#each production productioncountries }} {{@index}} {{ text }} {{/each}} @first set to true by the each helper for the first step of iteration {{#each production productioncountries }} {{#if @first}} main country of production {{ text }} {{/if}} {{/each}} @last set to true by the each helper for the last step of iteration {{#each production productioncountries }} {{ text }}{{#unless @last}}, {{/unless}} {{/each}}