This blog post captures some of the process and code tips and tricks used to create a PDF template for FPN and other modules.
...
On the first page of the creation, wizard pick HTML and pick the "Load Sample HTML" option (the MS Word option will be phased out, and has been kept for a while to support last years users).
The top large text area is the "Letter Contents", this is where the main template goes into, you can identify keywords and change them in here. It may be easier to copy the text out into a better HTML text editor then paste it back in when you are done. NOTE this letter contents section is not a FULL HTML page on its own, it is 3/4 of a page.
The 2nd large text area is the "Additional CSS", this is where formatting rules are applied, such as font, font size, spacing, colours etc.
You can upload your PDF letterhead temp[late and set the margins for the first page. Note you can set the Addressee details location to fit in a windowed envelope, this location is set irrespective of the rest of the page, to ensure it is exactly where it needs to be regardless of where other information may flow to see the information on the <address> tag further below.
When you are done, save the record. On the next page, you can preview the merge letter. What it does is merge the current Merge Letter with the first record in the current event. So it will help to make sure that record has photos, notes and details that will test the template properly, you may need to work in a test event for this.
Listing the Merge Tokens
From the mail merge settings page, Administration→Settings→Merge Templates select any of the templates records.
...
There are a few system build tokens that output dates. For example:
Token | Description |
---|---|
{$MERGE_DATE} | The date which merge document has been generated. |
{$MERGE_DATETIME} | The date and time which merge document has been generated. |
{$IN_TWO_WEEKS} | The date 2 weeks from today. |
{$IN_THREE_WEEKS} | The date 3 weeks from today. |
{$IN_FOUR_WEEKS} | The date 4 weeks from today. |
It is also possible to add a custom date. For example
...
Currently there are three override fields on the FPN form which are listed below along with the tokens you need to use for these fields for them to appear in the letter:
- Override Owner Details
- Override Property Number
- Override Location
{$item.overrideOwnerDetails}
{$item.overridePropertyNumber}
{$item.overrideLocation}
...
Code Block | ||||
---|---|---|---|---|
| ||||
/* Set the default font for the document - everything is relative to this. */ body { font-size: 11pt !important; font-family: arial, helvetica, sans-serif; } /* Define the headings relative to the default font */ h1 { font-size: 125%; font-weight: bold; } h2 { font-size: 100%; font-weight: bold; } h3 { font-size: 80; font-weight: bold; font-variant: small-caps; } /* Make the address box pop out (Grey good for testing) */ address { width: 80mm; height: 20mm; /*border: 1px solid grey; background-color: lightgrey; */ word-wrap: break-word; } /* Create left and right anchored text boxes */ .left-box { float: left; width: 49%; } .right-box { float: right; width: 49%; } /* Here's a big, red, important box for an important message */ .warning-box { border: 1px solid #ff0000; color: #ff0000; background-color: #ffcaca; padding: 4mm; font-size: 93%; } /* Create left, right, center and justify text styles */ .left-text { text-align: left; } .right-text { text-align: right; } .center-text { text-align: center; } .justify-text { text-align: justify; } /* Text for fine-print - can be wrapped multiple times */ .small-text { font-size: 85%; } /* Big, red warning text */ .warning-text { color: #ff0000; font-weight: bold; font-size: 95%; } .top-heading h1 { font-size: 150%; margin-top: 0; margin-bottom: 5pt; } .top-heading h2 { font-size: 125%; margin-top: 0; margin-bottom: 5pt; } .top-heading h3 { font-size: 110%; font-variant: normal; margin-top: 0; margin-bottom: 5pt; } |
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<!-- The address block can be positioned for windowed envelopes by uncommenting the positioning CSS --> <address> {if $item.overrideOwnerDetails} {$item.overrideOwnerDetails|nl2br} {else} {$assetContact.fullName} <br /> {$assetContact.address1}<br/> {$assetContact.address2}<br/> {$assetContact.address3} {$assetContact.address4} {/if} </address> <article> <div class="top-heading center-text"> <h2>SCHEDULE 15</h2> <h3>Country Fire Authority <br> Regulations 2014 <em>Reg. 112 (1)</em></h2> <h1>FIRE PREVENTION NOTICE</h1> </div> <br /> <br /> <br /> <!-- Put one box to the left and one to the right to format the top bit--> <div class="left-box"> <p> <strong>I direct:</strong> <br> <!-- The <address> block above is positioned under this phrase --> </p> </div> <div class="right-box right-text"> <p> <strong>Notice #{$noticeNumber}</strong><br /> Issued {$MERGE_DATE}<br /> <br /> <br /> <em>The owner or occupier of:</em> <br /> {if $item.overrideLocation} {$item.overrideLocation} {else} {$item.Asset.friendly} {/if} <br /> Property No. {if $item.overridePropertyNumber} {$item.overridePropertyNumber} {else} {$item.Asset.friendlyCode} {/if} </p> </div> <!-- Leave a big space here for the address window, which was defined above and is absolutely positioned here --> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <!-- Here's a centred warning box with warning text inside --> <p class="warning-text warning-box center-text"> <strong>Failure to comply with this notice will result in a fine of $1,501652 being issued.</strong> <br /><br /> Penalty amounts are determined under the <em>Country Fire Authority Act 1958.</em> <br /> The amount of a penalty unit increases annually on 1 July under the <em>Monetary Units Act 2006</em>. </p> <!-- Now a series of paragraphs follow. Just use basic HTML such as p/h1/h2/h3, ol/ul/li, strong/em and br --> <h2> To do the following work in respect to land at {$item.Asset.friendly} by {$IN_THREE_WEEKS}. </h2> <p> {$conditionsAll} <!-- TODO: This should become an array with ol/li formatting, but {$conditionsAll} doesn't yet support that --> </p> <!-- if there are special notes, add another paragraph --> {if $specialNotes} <h2>Special Instructions:</h2> <p>{$specialNotes}</p> {else} <br /> <!-- keep some space when there are no notes space --> {/if} <p> <em>These works are necessary to protect life or property from the threat of fire.</em> </p> <br /> <p class="warning-text center-text"> If you are unable to complete the work by the due date contact 03 555 1234.YOUR PHONE NO </p> <br /> <br /> <!-- Signature block --> {$ASSIGNEE_SIGNATURE}<br /> <strong>{$ASSIGNEE_NAME}</strong><br /> {if $ASSIGNEE_SIGNATURE_TEXT} {$ASSIGNEE_SIGNATURE_TEXT}<br /> {else} Fire Prevention Officer<br /> {/if} {$MERGE_DATE} <br /> <!-- Page two is created only if there are attached media --> {if $media} <hr /> <br /> <h1 class="center-text">Evidence</h1> <p> {foreach from=$media item="inspectionPhoto"} <img class="media" src="{$inspectionPhoto}"> {/foreach} </p> {/if} <!-- End of page two media --> <!-- Here's the last page is the T&Cs --> <hr /> <br /> <h1 class="center-text">Explanatory Note for a Schedule 15 Fire Prevention Notice </h1> <div class="small-text justify-text"> <h2>Power and Purpose</h2> <p> The Municipal Fire Prevention Officer of the Council has the power under section 41 of the <em>Country Fire Authority Act 1958</em> to issue this notice. </p> <p> The purpose of this notice is to require to you take the necessary steps to protect your life and property, and that of your neighbours, from the threat of fire. </p> <h2>Effect of not complying with this notice</h2> <p> If you do not comply with this notice within the time specified or you do not lodge an objection (see below): <ul> <li> The Municipal Fire Prevention Officer may arrange for the Council, a fire brigade or other contractor to enter upon your land and take the steps specified in this notice. The Council will then send you an account for the cost of taking these steps. If you do not pay the account, the Council can take you to Court to recover the cost including interest on the money owed (see sections 225 and 232 <em>Local Government Act 1989.</em>) </li> </ul> In addition: <ul> <li> The Municipal Fire Prevention Officer may serve you with a Fire Prevention Infringement Notice (“infringement notice”) for failing to comply with this notice and requiring you to pay a penalty of 10 penalty units within a specified time (Not less than 21 days after the infringement notice has been served). Failure to pay the infringement penalty by the due date may result in further enforcement action being taken which may incur further costs. </li> </ul> Or <ul> <li> Proceedings may be taken against you for a failure to comply with this notice. If proceedings are taken, you can be fined up to 120 penalty units or imprisoned for a period of up to 12 months, or both (see section 41D(1) <em>Country Fire Authority Act 1958.)</em> </li> </ul> </p> <h2>Objection</h2> <p> You can object to this notice if you wish (see section 41B <em>Country Fire Authority Act 1958</em>,) by lodging your objection with the Municipal Fire Prevention Officer within 7 days of the service of this notice, stating your grounds of objection. </p> <p>Within 14 days of lodging an objection, the Municipal Fire Prevention Officer must confirm or vary this notice (specifying the new time within which you must comply) or withdraw this notice. </p> <h2>Appeals</h2> <p> If you have lodged an objection and the Municipal Fire Prevention Officer fails to confirm, vary or withdraw the notice within 14 days, or you are not satisfied with a confirmation or variation of the notice, you may appeal in writing to the Chief Officer (see section 41C <em>Country Fire Authority Act 1958.</em>) </p> <p> Appeals must: <ol> <li> Be in writing; </li> <li> Be lodged with the Chief Officer, Country Fire Authority, 8 Lakeside Drive, East Burwood, 3151, within 7 days of the 14 day period described above, or within 7 days of the confirmation or variation (whichever is earlier); </li> <li> Fully state the grounds of your appeal. </li> </ol> </p> <p> The Chief Officer (or a delegate) will then consider whether your appeal is valid. To do this, an investigation will be made of your case. In the course of the investigation, an officer of the Country Fire Authority may visit you to assess the matter. When considering your appeal the Chief Officer (or a delegate) will take into account all relevant circumstances, including the proper needs of conservation, and any alternative means of addressing the threat of fire. </p> <p> After considering the appeal, the Chief Officer (or a delegate) must either confirm, vary or cancel the notice. You will be notified in writing of the decision. </p> <p class="center-text"> <strong>If you have any enquiries, please contact the Municipal Fire Prevention Officer at Council.</strong> </p> </article> |
...