Skip to main content
All CollectionsTools
Template Reference
Template Reference

Templates contain markup for creating multiple types of output files such as PDF's. You can create custom templates for your application.

Betty Blocks avatar
Written by Betty Blocks
Updated over a week ago

Warning!

This is a legacy document. The features described below are only usable within the classic-generation environment.

Currently, Betty Blocks offers faster and more advanced options that are available in next-gen. Before you start working on some new features in your application, consider doing it using the next-gen version. Good luck!

Templates can be included as parts of your webpage and accessed from within the user interface. They can be used for providing the structure and content for PDF files and emails, for development scripts or for cascading style sheets (CSS) that control key elements for applying consistent brand styling across your application.

Note: We are constantly updating the Betty Blocks platform to increase the ease-of-use of our platform. Certain functionality is currently still managed in our previous IDE but works seamlessly with our updated environment. This article explains how you access the template functionality that is managed in our previous environment.

You can also refer to the Product changes for a list of updates to the platform.

Creating templates

1. Open the Tools menu from the Builder Bar.

If you are already in the previous environment, go to Step 3.

2. Select Templates from the Tools menu.

Note: You may be requested for your login details.

Once completed, please follow from step 3.

3. If the Templates page is not immediately displayed, open the Tools menu and select Templates (A).

The Templates (B) page is displayed. You can select the template type you want to work with from the template menu bar (C). See Types of templates below for details.

Types of templates

The following explains the different template types that you can select to work with from the template menu bar.

Endpoint templates

These templates can be directly connected to an endpoint or can function as a layout of an endpoint. They usually contain HTML with links to CSS and Scripts.

Google

Contain layouts for using with a Google docs integration. You can build templates for requesting data from a google docs file.

Mails

Used in mail actions and contain text and layout for an email.

Portable Document Format (PDF's)

Used for pdf generate actions and contain Prince XML markup.

If you want to learn more about creating PDFs, please refer to Applying pdf properties.

Simple Object Action Protocol (SOAP)

When you create a new web service within the Betty Blocks platform, a template is automatically generated. You can create your own specific SOAP template, or reuse existing code and adapt for your application.

Javascripts

You can use this section for storing that can be added to endpoint templates.

Stylesheets

Used to save stylesheets that can be added to endpoint templates.

Partials

Note: You can create Partials in the Pages section of our current environment. See Creating a partial for details.

Used for saving small reusable blocks of HTML code. They can be used for website blocks and used/reused on multiple pages. A consistent style and use can be applied across an application using blocks.

Note: You can create partials within the Pages module.

You can view an existing template file by selecting Endpoint templates (A) from the template menu and selecting a file (B) in the list displayed. The details for the file are displayed (C). Click on the Edit (D) button to view the details

As shown in the example below, you can edit the selected file in the edit frame (E) that displays the code details. In this case, the HTML code can be edited. You can use the scroll bar (F) to navigate the frame to specific lines of code. You can also use the preview (G) button to display a condensed view of the code.

Note: Details of dependent items (items that are related to the file) are detailed here. In this example, there are currently no dependent items. You should check dependencies before deleting files to ensure that connections in your application are not affected as this can result in errors.

Creating a new template

You can create new templates by:

  1. Selecting the type of template (A) from the menu bar and then clicking on the New (B) button

  2. Clicking on the New (C) button and selecting the Kind (D) of template from the pull-down menu.

Specify a Name (E) for the file in the name field. Please avoid using spaces or special characters (#,$,% etc) as these can cause problems in your application.

Add the required code in the HTML (F) frame . You can build the required code and edit as required when needed.

Press the Save (G) button to save the file in your list of templates.

The details for the saved file are displayed (H) and the file is added to the list of templates for the Kind created.

Press Close to close the pane to return to the template list.

Liquid reference details

You can use the liquid reference for Javascript and Stylesheets where required in your user interface. The liquid detail tag is displayed when you click on these template files.

Deleting a template

You can delete a template by pressing the Delete button when in Edit mode.

Note: Please ensure that you have checked and resolved any dependencies before you delete a template file as you can otherwise introduce errors in your application.

See What are Dependencies? for more information.

You can view dependencies in the Dependent Items section of the window when in edit mode.


Tracking changes on a file

Any changes to template files are logged. To view the change to a file, select the file from the template list (A) and press on the Changelog (B) button as shown in the following example. The details of when a variable was changed and by whom is detailed in the change log.

Did this answer your question?