Skip to content

Combining Templates

Pelle Nilsson edited this page Oct 30, 2016 · 1 revision

It can sometimes be useful to combine multiple templates into a single counter, to allow for parts of templates to be reused and combined in different ways on the same countersheet.

This was more important to be able to do in older versions of the extension. It can still come in handy and be useful to know about, and is used in some included examples, however for almost all uses of combined templates it will be easier to work with Options or Multiselect or Clones instead to achieve the same results (or even external images).

On each header row in the CSV a single template is normally given in the first column (it is not mandatory). There are several other ways of adding templates to the counters though:

  1. Use a header cell with the id of the template prefixed with a @ (eg @unit). This adds the contents of a template but without its rectangle (the rectangle giving the template its id and size).
  2. Use a header cell with the id of the template prefixed with a + (eg +unit). This adds the contents of the template including rectangle.
  3. Use a header cell with just a @. Then put the name of the template to add for each counter in that column. This adds templates without rectangles just as for 1 above.
  4. Use a header cell with just a +. Then put the name of the template to add for each counter in that column. This adds templates including rectangles just as for 2 above.

Templates will be added from left to right, with the first one being at the bottom of the counter, the later ones being added on top of previous ones (thus obscuring parts of them when there is overlap).

It is probably very rare to want to add more than one template with a background rectangle to the same counter. Perhaps if the rectangle is semi-transparent or of a smaller size than the template(s) below it. But in general method 2 above is probably not so useful.

Method 4 however while similar can be very useful. Leave the first cell in the header blank, where the template is normally defined, and instead include a column with a + and then each counter below the heading can have its own template.

Method 3 can be used to overlay different templates (without their background rectangle) on top counters. This was very useful in early versions of the extension but there are probably rarely a reason to use this in a new project (see top of this page).

Method 1 might be useful when having many different headers in the same CSV file and having each one combine different sets of counters. Or perhaps if re-using the same template SVG for different projects to be able to combine them in different ways for each project without having to redraw them to combine the actual template groups.

If different counters use different templates, but some column should still affect something (eg a text or image) in all of them, use Wildcards in the header for that column and make sure the objects to modify in each template has an id following a pattern that can be matched by the same wildcard (eg icon-gold and icon-silver both match icon-*).

See also: Clones, Option, Multiselect, Set Image, Wildcards

Clone this wiki locally