ABC Hints&Tips Overviews Reference Glossary Support
Contents : Overviews : Templates
Using templates in SuperMemo

Use templates to give your elements your favorite look

A template in SuperMemo is a definition of an element's appearance. Templates are used to create many similarly looking elements, e.g. with a given color, image, font, etc. The first thing to do with templates is to create a template (i.e. the "common look"). You can do it by first creating an element that looks the way you want other elements to look. This element will contain all components that are common to all elements that will be created with the use of the template (e.g. two text fields and one picture components, etc.). All components should have their properties set in the way as in the "common look" (e.g. color, position on the screen, font, etc.). You set the properties of components by using the component menu.

After creating the element with the desired look, you can use Template : Save as template on the element menu (this menu opens with Alt+F10 or with a right-click over the element toolbar). 

Saving templates with Save as template makes it possible to keep a "gallery of looks" for future use. This gallery is called the template registry. You can save any element as a template. If you want particular texts, sounds or pictures to be associated with the template, use Temple : Save with objects. Save as template does not save objects associated with components. For example, it will save the position and color of a text component, but it will not save the text (e.g. "US Constitution").

The template registry (i.e. the gallery of templates) can be viewed with Search : Template on the main menu

If you want a template to be used by default each time you choose Add new or press Alt+A, use Template : Save as default (Ctrl+Alt+M). Save as default will save the template in the same way as Save as template but will also make this template the default template for the currently used category. If you now use Add new (Alt+A), all newly added items will use the default template. The appearance of previously added items will not be affected. 

To give an element a selected look, apply the appropriate template to this element. Any template can be selected from the template registry and applied to any element with Template : Apply template (Ctrl+Shift+M). After you choose a template in the registry, click the Accept button at the bottom of the template registry window (or press Enter). Applying a template does not overwrite the "old look". You can remove the applied template by choosing Template : Detach template.

Using fonts with a template 

To associate a font with a text component in a template, use Text : New font, Text : Edit font or Text : Link font on the component menu (see more: Font options). If you want to change fonts globally in a set of existing items, you need to use plain text components. This comes from a difference between plain text components and HTML text components in the way they interpret the font associated with the template:

Category templates help you switch fast between different templates for different learning subjects 

If you want to associate a template with a given subject, e.g. Chemistry, you can use category templates. You will need the following before you begin:

  1. Define a template as described above (e.g. by reworking an existing template and saving it with Template : Save as default or with Ctrl+Alt+M)
  2. Define a new category or redefine an existing category. When you create a new collection, you begin with a single category whose name is the same as the name of the collection (see: Using categories)

To define a category template do as follows: 

  1. Choose Search : Categories on the main menu (if you are not at the professional level, switch the level, e.g. with Ctrl+Alt+F12)
  2. Select the category (e.g. by typing its name at the top of the category registry window)
  3. Click the Template button
  4. Choose the template from the template registry (e.g. by typing its name at the top of the template registry window)
  5. Click Accept (at the bottom of the template registry window)
  6. Close the category registry window

The above will make sure that your template is used each time you choose Add new or press Alt+A as long as your category is selected as the current category in the category combo-box.

You can apply a template to many elements at once

You can change the look of many elements at the same time. If your elements use a given template, go to one of these elements and simply redefine the template. If your elements use different templates or use no template at all, you can apply a template to all of them by choosing Process branch : Template : Apply template in the contents window, or Process browser : Template : Apply template in the browser

Template operations reference

Here is the summary of template operations on the Template submenu of the element menu (use Alt+F10 to open this menu or right-click over the empty element area or over the element toolbar):

Advanced template operations

Adding components to a group of existing elements

If you want to add new components to a group of elements, use Add template in the contents window or in the browser. This will retain the old components and add new components from the added template. Add to template is similar to Apply template but the contents of the new template is simply superimposed over the old template. This way, you can create a template with an image and add this image to a selected group of elements by adding the image template

Transferring templates between collections

If you want to transfer templates (or single elements) between different collections, use Template : Save to file and Template : Load from file. You can also use Edit : Copy element with Edit : Paste template and Edit : Paste element to transfer templates and elements within a collection or between different collections using the clipboard

See also: FAQ: Templates in SuperMemo