# Form 11 Shortcodes

<p class="callout info">The Form 11 Shortcodes feature allows administrators to dynamically auto-fill specific violation details into system templates. Its primary purpose is to automatically pull nested data directly from a violation record—such as ticket numbers, user profiles, or vehicle details—and populate the issued Form 11 accurately without manual data entry. This article is intended for OPS-COM administrators responsible for configuring system templates and violation notices.</p>

## Setup and Configuration

This feature involves adding specific formatting strings directly to your system templates.

**Admin Side:** Administrators must have the appropriate system role permissions to access and edit system templates.

1. Navigate to the specific system template you wish to modify.
2. Insert the required shortcode syntax into the text editor where you want the violation data to appear.
3. Save the template.

**User Side:** This is strictly a backend configuration tool. End-users will simply see the fully rendered Form 11 document with their specific violation details already auto-filled.

## Using this Feature

Administrators can use the following syntax rules and data packets to construct dynamic shortcodes for their Form 11 templates.

### Understanding the Base Shortcode

The base shortcode for pulling Form 11 violation data is formatted as follows:

`[values show=violation._____]`

The blank space must be filled with a specific variable name to pull from the violation information packet. The packet itself is always called `violation`, and this identifier must be placed at the very start of any value call.

### Navigating Nested Values

For each nested value within the system's data packet, the parent packet name must be added as part of the variable string. Each part of the path is separated by a period (`.`), with the specific variable you want to output placed at the end.

### Example Shortcodes

The following table provides common examples of Form 11 shortcodes. To return a specific value in the same section, simply replace the provided variable name with the sibling value you want to output.

<table data-path-to-node="19" id="bkmrk-example-shortcode-de" style="width: 100%; height: 825.282px;"><thead><tr style="height: 34.1094px;"><td style="width: 44.5126%; height: 34.1094px;">**Example Shortcode**</td><td style="width: 55.3683%; height: 34.1094px;">**Description**</td></tr></thead><tbody><tr style="height: 35.7344px;"><td style="width: 44.5126%; height: 35.7344px;"><span data-path-to-node="19,1,0,0">`[values show=violation.Ticket]`</span></td><td style="width: 55.3683%; height: 35.7344px;"><span data-path-to-node="19,1,1,0">Returns the violation ticket number.</span></td></tr><tr style="height: 58.4688px;"><td style="width: 44.5126%; height: 58.4688px;"><span data-path-to-node="19,2,0,0">`[values show=violation.user_info.username]`</span></td><td style="width: 55.3683%; height: 58.4688px;"><span data-path-to-node="19,2,1,0">Returns the username of the user the violation belongs to.</span></td></tr><tr style="height: 58.4688px;"><td style="width: 44.5126%; height: 58.4688px;"><span data-path-to-node="19,3,0,0">`[values show=violation.writer.DisplayName]`</span></td><td style="width: 55.3683%; height: 58.4688px;"><span data-path-to-node="19,3,1,0">Returns the display name of the admin who assigned the violation to the user.</span></td></tr><tr style="height: 55.2188px;"><td style="width: 44.5126%; height: 55.2188px;"><span data-path-to-node="19,4,0,0">`[values show=violation.vehicle.Plate]`</span></td><td style="width: 55.3683%; height: 55.2188px;"><span data-path-to-node="19,4,1,0">Returns the plate of the vehicle the violation was assigned to, if applicable.</span></td></tr><tr style="height: 81.2031px;"><td style="width: 44.5126%; height: 81.2031px;"><span data-path-to-node="19,5,0,0">`[values show=violation.vehicle.province.ProvName]`</span></td><td style="width: 55.3683%; height: 81.2031px;"><span data-path-to-node="19,5,1,0">Returns the province or state of the vehicle plate.</span></td></tr><tr style="height: 81.2031px;"><td style="width: 44.5126%; height: 81.2031px;"><span data-path-to-node="19,6,0,0">`[values show=violation.vehicle.colour.ColourName]`</span></td><td style="width: 55.3683%; height: 81.2031px;"><span data-path-to-node="19,6,1,0">Returns the registered colour of the vehicle.</span></td></tr><tr style="height: 81.2031px;"><td style="width: 44.5126%; height: 81.2031px;"><span data-path-to-node="19,7,0,0">`[values show=violation.vehicle.plate_type.TypeName]`</span></td><td style="width: 55.3683%; height: 81.2031px;"><span data-path-to-node="19,7,1,0">Returns the plate type of the vehicle.</span></td></tr><tr style="height: 81.2031px;"><td style="width: 44.5126%; height: 81.2031px;"><span data-path-to-node="19,8,0,0">`[values show=violation.vehicle.vehicle_type.TypeName]`</span></td><td style="width: 55.3683%; height: 81.2031px;"><span data-path-to-node="19,8,1,0">Returns the type of the vehicle.</span></td></tr><tr style="height: 58.4688px;"><td style="width: 44.5126%; height: 58.4688px;"><span data-path-to-node="19,9,0,0">`[values show=violation.vehicle.make.MakeName]`</span></td><td style="width: 55.3683%; height: 58.4688px;"><span data-path-to-node="19,9,1,0">Returns the make of the vehicle.</span></td></tr><tr style="height: 58.4688px;"><td style="width: 44.5126%; height: 58.4688px;"><span data-path-to-node="19,10,0,0">`[values show=violation.location.LocationName]`</span></td><td style="width: 55.3683%; height: 58.4688px;"><span data-path-to-node="19,10,1,0">Returns the name of the location the infraction happened.</span></td></tr><tr style="height: 58.4688px;"><td style="width: 44.5126%; height: 58.4688px;"><span data-path-to-node="19,11,0,0">`[values show=violation.details.0.Ticket]`</span></td><td style="width: 55.3683%; height: 58.4688px;"><span data-path-to-node="19,11,1,0">Returns the violation ticket number (alternate value location).</span></td></tr><tr style="height: 83.0625px;"><td style="width: 44.5126%; height: 83.0625px;"><span data-path-to-node="19,12,0,0">`[values show=<span class="citation-698 citation-699 citation-700">violation.details.0.type.ViolationDescr]</span>`<span class="citation-698 citation-699 citation-700 citation-end-700"><sup class="superscript embedded" data-turn-source-index="1"></sup></span><span class="citation-698 citation-699 citation-end-699"><sup class="superscript embedded" data-turn-source-index="2"></sup></span><span class="citation-698 citation-end-698"><sup class="superscript embedded" data-turn-source-index="3"></sup></span></span></td><td style="width: 55.3683%; height: 83.0625px;"><span data-path-to-node="19,12,1,0"><span class="citation-695 citation-696 citation-697 citation-end-697">Returns the violation type description.<sup class="superscript embedded" data-turn-source-index="4"></sup></span><span class="citation-695 citation-696 citation-end-696"><sup class="superscript embedded" data-turn-source-index="5"></sup></span><span class="citation-695 citation-end-695"><sup class="superscript embedded" data-turn-source-index="6"></sup></span></span></td></tr></tbody></table>


<p class="callout info">If a shortcode is entered incorrectly, or if the targeted data field is empty (null) for that specific user or vehicle, the system will simply leave that space blank on the generated Form 11.</p>

### <span class="citation-686 citation-687 citation-688 citation-end-688">Violation Packet Reference<sup class="superscript embedded" data-turn-source-index="13"></sup></span><span class="citation-686 citation-687 citation-end-687"><sup class="superscript embedded" data-turn-source-index="14"></sup></span><span class="citation-686 citation-end-686"><sup class="superscript embedded" data-turn-source-index="15"></sup></span>

<span class="citation-683 citation-684 citation-685 citation-end-685">The violation info packet is formatted like the JSON example below. T<sup class="superscript embedded" data-turn-source-index="16"></sup></span><span class="citation-683 citation-684 citation-end-684"><sup class="superscript embedded" data-turn-source-index="17"></sup></span><span class="citation-683 citation-end-683">he values on the left are the exact variable names you must use in your shortcode path, while the values on the right are example outputs returned by this packet.<sup class="superscript embedded" data-turn-source-index="18"></sup></span>

```json
{
    "ViolationID": 237,
    "SemPermitID": null,
    "Ticket": "TT-19026",
    "VehicleID": 5,
    "Spoiled": 0,
    "TicketType": 1,
    "Issued": "2024-07-17 16:11:00",
    "convNotice": null,
    "Due": "2024-07-27 16:11:00",
    "ViolationTypeID": -1,
    "Fine": "50.0000",
    "AdjustedFine": "20.0000",
    "Towing": "0.0000",
    "taxAmount": "0.0000",
    "Writer": 7,
    "LocationID": 10,
    "Comment": null,
    "TicketAppeal": null,
    "appealType": 0,
    "appealFormat": null,
    "AccessAdminID": 50,
    "ActionedPer": null,
    "Created": "2024-07-17 20:12:08",
    "AppealUserID": 0,
    "AppealProcessDate": null,
    "AppealAdminID": 0,
    "AppealComment": null,
    "AppealAdminComment": null,
    "AutoNotice": 0,
    "ProcessedByCollection": null,
    "SentToCollections": null,
    "PrivateComments": "",
    "DriveAway": 0,
    "UUID": null,
    "VioNotice": null,
    "latitude": null,
    "longitude": null,
    "Warning": null,
    "userid": null,
    "incidentID": null,
    "failToIdentify": null,
    "pin": "YL",
    "duplicate": null,
    "AdjustmentReason": null,
    "notices_count": 1,
  
    "user_info": {
            "UserID": 5,
            "studentNo": null,
            "employNo": "00800147",
            "username": "mashbury",
            "firstName": "Michael",
            "preferredname": null,
            "lastName": "Ashbury",
            "street": "688 Zaproxy Ridge",
            "city": "East Romaineburgh",
            "prov": 9,
            "postal": "K2G5B1",
            "email": "mash-bury@tomahawk.ca",
            "display_name": "Michael Ashbury",
            "account_no": "00800147",
            "prov_name": "Ontario",
    },
  
    "writer": {
            "AdminAccessID": 7,
            "Username": "admin",
            "DisplayName": "Administrator"
    },
  
    "vehicle": {
            "VehicleID": 5,
            "Active": 1,
            "Plate": "MASH",
            "Year": 1998,
            "TotalVio": 12,
            "TotalUnpaid": 2,
            "TotalWarning": 0,
            "vehicleAlert": true,
            "vin": "JNAMA43H9XGE50339",
            "electric_vehicle": false,
          
            "province": {
                    "ProvName": "West Virginia",
                    "ProvCode": "WV",
            },

            "make": {
                  "MakeName": "Toyota"
            },
            
            "colour": {
                  "ColourName": "Black"
            },
            
            "plate_type": {
                  "TypeName": " Passenger"
            }
        
            "vehicle_type": {
                  "TypeName": " Van"
            },
      
    },
  
    "location": {
            "LocationID": 10,
            "LocationName": "Hospital & Administration Building",
    },
  
    "details": {
            "ViolationsDetailID": 359,
            "ViolationID": 237,
            "Ticket": "TT-19026",
            "ViolationTypeID": 16,
            "LocationID": 10,
            "offenceFine": 50,
            "discountFlag": 1,
            "discountAmount": 20,
            "discountHours": 240,
          
            "type": {
                    "ViolationTypeID": 16,
                    "ViolationDescr": "No Parking Snow Route - Mandatory Towing",
                    "DefaultCost": 50,
                    "discountFlag": true,
                    "discountAmount": 20,
                    "discountHours": 240,
            }
    }
}
```

---

## <span style="color: rgb(22, 145, 121);"><span class="citation-682 citation-end-682">Best Practices and Considerations<sup class="superscript embedded" data-turn-source-index="19"></sup></span></span>

- <span style="color: rgb(22, 145, 121);">**<span class="citation-681">Maintain exact syntax:</span>** **<span class="citation-681">Variable names are case-sensitive and must exactly match the data packet format.</span>**<span class="citation-681"> For example, using </span>`<span class="citation-681">provname</span>`<span class="citation-681"> instead of </span>`<span class="citation-681">ProvName</span>`<span class="citation-681 citation-end-681"> will cause the shortcode to fail.<sup class="superscript embedded" data-turn-source-index="20"></sup></span></span>
- <span style="color: rgb(22, 145, 121);">**<span class="citation-680">Understand nested logic:</span>** **<span class="citation-680">When targeting nested arrays (like user\_info </span><span class="citation-679 citation-680">or vehicle), ensure you include all parent variables separated by periods in your shortcode path.</span>**<span class="citation-679 citation-680 citation-end-680"> You cannot skip levels in the hierarchy.<sup class="superscript embedded" data-turn-source-index="21"></sup></span><span class="citation-679 citation-end-679"><sup class="superscript embedded" data-turn-source-index="22"></sup></span></span>
- <span style="color: rgb(22, 145, 121);">**<span class="citation-677 citation-678">Test templates thoroughly:</span>** **<span class="citation-677 citation-678">Always test new Form 11 templates by generating a sample notice for a dummy violation.</span>**</span><span class="citation-677 citation-678 citation-end-678"><span style="color: rgb(22, 145, 121);"> This verifies that all shortcodes are rendering correctly and formatting as expected before they are sent to live users.</span><sup class="superscript embedded" data-turn-source-index="23"></sup></span><span class="citation-677 citation-end-677"><sup class="superscript embedded" data-turn-source-index="24"></sup></span>