⟵ hearthere ⟶
  • Training course
  • Creating simple tables and fields
  • Codes base level
  • Selects and links between tables
  • Table settings basic level
  • Prefilters base level
  • Conditional formatting basic level
  • Action codes base level
  • Using pop-up windows
  • Cycles base level
  • Roles and users on the web
  • Codes advanced level
  • Action codes advanced level
  • Prefilters advanced level
  • Field and table settings advanced level
  • Cycles advanced level
  • Formatting advanced level
  • Select-Tree
  • Executing a scheduled action code
  • Printing and emailing
  • Template printing
  • Nested templates
  • Email sending
  • Attaching files to emails
  • Notifications
  • API interaction
  • Adaptivity and Sections
  • Template printing

    What function triggers a print?

    linkToPrint

    What must the template be typed in for the linkToPrint function to work?

    Templates should be formatted in html and stored in the table System Tables —> Main —> Templates —> Print Templates.

    A template has a unique name, and cs-styles can be separated into the styles field.

    Type — Page.

    How do I specify variable substitutions in the template?

    Curly braces – {variable}

    Is it possible to pass in a linktoPrint row and specify in the template which key to get?

    Yes, in this case, the replacement template will look like this — {row_name["key"]}.

    What happens if we don't pass a variable?

    The replacement will not occur and the element will be shown in curly braces.

    What happens if we pass an extra variable?

    Nothing will happen.

    How do I specify the number formatting directly in the template?

    There are several options for formatting variables in a template — the full list is in the documentation.

    To format a number directly in the template, you need to do the following:

    After the variable name, put a comma (attention! without spaces), after the comma write number, put a colon, and enter the parameters separated by | in a specific sequence:

    • Number of decimal places.

    • Decimal separator.

    • Thousands separator.

    • Units of measurement — if null or empty string is passed, the units of measurement are not displayed.

    <div>{variable_name,number:0|,| | $}</div>
    {"num":10000.10}
    
    Result:
    <div>10 000 $</div>
    

    but actually, it is better to format the variable as needed before passing it to the template, for example through numFormat.