Templates

Cookbook

The Cookbook shows snippets of script that can be used on templates. Many of these pieces can be copy and pasted into a template and used immediately, but the offset will need to be changed to position the element on the page. Others are a starting point and can be edited to suit your requirements.

Examining the the Sample templates will reveal many other ideas.

Show the Roll class or homeroom on each page

Sometimes you may want the roll class on each course page of a report. On the template you can use lines like these:

/offset/,100,100
/serif/,12
/left/
/text/,0,0,400,100,Homeroom:
/field/,roll,250,0,600,100

The roll field is the roll class (or homeroom) of the student, provided these two conditions are met:

The same course is used for each roll class in the Edit Classes command.

That course has the Used for cover or roll class option turned on in the Edit Courses command.

If you want to ensure that the distance between the colon and the name of the class you could use this slightly more complex script.

/offset/,100,100
/serif/,12
/left/
/field/,roll,0,0,0,0
/text/,0,0,400,100,subtextHomeroom: ^

Show the number of pages on the cover of a report

On the cover to show the number of pages in the report, here is one way to do it:

/offset/,100,100
/sans/,12
/left/
/field/,subjectcount,0,0,0,0
/text/,0,0,1800,100,"subtextReport contains ^ pages, issued without alteration or erasure."

The subjectcount field is the total number of subjects the student is doing, this normally includes the roll class/homeroom course, but since that course is used for the cover the total will be correct.

Here the subtext technique is used, because it is very useful for formatting fields with fixed text. If you are not sure how it works you can refer to the Advanced Techniques topic. topic

Show the page number on each page of a report

This builds on the previous example to include the page number on every page:

/offset/,0,2800
/serif/,12
/centre/
/field/,subjectnumber,0,0,0,0
/field/,subjectcount,0,0,0,0
/text/,0,0,1900,100,"subtextPage ^ of ^"

Here the offset and and justification puts the text in the centre at the bottom of an A4 page.

Shading the background of a heading

Some shading can add visual interest to a page. Here is a simple example:

/offset/,100,100
/colour/,235,235,235
/brush/,solid
/rectangle/,0,0,1800,140
/sans/,24,bold
/middle/
/text/,0,0,1800,140,Your High School

Provided the three numbers on the /colour/ line are the same, the shading will be grey. The larger the numbers, with the maximum being 255, the lighter the shade.

 

Contents
Search