Silverfin

The Silverfin Developer Hub

Welcome to the Silverfin developer hub. You'll find comprehensive guides and documentation to help you start working with Silverfin as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started

Remove

Removes the argument in a given string.

{{ "BE0.524.802.662" | remove:"BE" }}
Output
0.524.802.662

Replace

Replaces the argument_1 by argument_2 in the given string.

{{ "Comm.VA" | replace:".","" }}
Output
CommVA

Upcase

Turns all letters of the string in capital letters

{{ "Silverfin" | upcase }}
Output
SILVERFIN

Downcase

Puts all letters of the string in small letters.

{{ "Silverfin" | downcase }}
Output
silverfin

Append

Attaches the argument string after the given string.

{{ "Tim Vandecasteele" | append:” with a representative” }}
Output
Tim Vandecasteele with a representative

Prepend

Attaches the argument string before the given string.

{{ "9050 Ledeberg" | prepend:"B - " }}
Output
B - 9050 Ledeberg

Size

Returns the numbers of characters in a string.

{{ "BE0.524.802.662" | size }}
Output
15

Strip

Removes all whitespaces before and after a given string (it doesn't remove spaces between words).

{{ "   BE0.524.802.662   " | strip }}
Output
BE0.524.802.662

Default

This allows to set a default value when a variable or [linkto database variable]database variable[endlinkto] is nil, false or empty

📘

{% assign company_form = company.company_form | default:”NV” %}
Let's say that the database variable company.company_form has not been inputted any value in the company settings

{{ company_form | default:"NV" }}
Output
NV

Date

Outputs a specific date format of a string.

{{ "31/12/2018" | date:"%Y" }}
Output
2018

📘

Usable formats

%a - The abbreviated weekday name (Sun)
%A - The full weekday name (Sunday)
%b - The abbreviated month name (Jan)
%B - The full month name (January)
%c - The preferred local date and time representation
%d - Day of the month (01..31)
%H - Hour of the day,24-hour clock (00..23)
%I - Hour of the day,12-hour clock (01..12)
%j - Day of the year (001..366)
%m - Month of the year (01..12)
%M - Minute of the hour (00..59)
%p - Meridian indicator (AM or PM)
%S - Second of the minute (00..60)
%U - Week number of the current year, starting with the first Sunday as the first day of the first week (00..53)
%W - Week number of the current year, starting with the first Monday as the first day of the first week (00..53)
%w - Day of the week (Sunday is 0,0..6)
%x - Preferred representation for the date alone,no time
%X - Preferred representation for the time alone,no date
%y - Year without a century (00..99)
%Y - Year with century
%Z - Time zone name
%% - Literal % character

Minus

Using a minus will remove initial zeros.

Without minus:

{{ "01/01/2018" | date:"%d %B %Y" }}

With minus:

{{ "01/01/2018" | date:"%-d %B %Y" }}
Output
Without minus:

01 January 2018

With minus:

1 January 2018

Today

To the date of today, you can do the following:

{{ "now" | date:"%d/%m/%Y" }}

Localized Date

If you need to display a date according to the time-zone from where template is being executed, you can used the "localized_date" filter.

🚧

This date will be only shown in the user's browser, but won't be exported to the PDF file.

{{ "now" | localized_date:"%d/%m/%Y %H:%M" }}

Slice

Gives a substring of a given string, beginning from a certain index that can be given as well the length of the substring.

{{ "BE0.524.802.662" | slice:4, 11 }}
Output
524.802.662

Updated 5 months ago

String


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.