Step 9: Add the state warning¶
Most states require specific warning language on cannabis packaging. You do not have to type it: T3 ships the text for you.
- Add a Text layer and set its Layer description to
State warning. - Drag it into a band along the bottom edge, almost the full width:
X: 4% – 96%,Y: 87% – 99%. - Set Value template to
{{ t3.text.ca_cannabis_warning_disclosure }}. Insert Field lists it under Built-in Fields. - Set Font Size to
5, Resize Strategy toShrink Text, and Horizontal Alignment toLeft.
Finally, turn off Draw borders. The label is finished.
t3is a namespace T3 fills in on every request, separate from your own data and your own images. Nothing to upload and nothing to keep up to date.The key carries the state abbreviation, so
co_cannabis_warning_disclosureis the Colorado wording andma_cannabis_warning_disclosurethe Massachusetts one. That abbreviation matches the Metrc hostname your packages come from, so printing this label in another state is a one-key edit. Seventeen states are covered; see State Disclosures.Warning text is long and every state's is a different length, which is exactly the case
Shrink Textexists for. Give it the space you can spare and let it size itself.The bold lead-in comes from the text itself. Disclosures may carry simple HTML such as
<b>, and aTextelement renders it.
PDF with borders • Layout JSON
Behind the scenes
{
"name": "Tutorial label",
"labelContentLayoutElements": [
{
"description": "Tag barcode",
"elementType": "CODE128_BARCODE",
"xStartFraction": 0.05,
"xEndFraction": 0.95,
"yStartFraction": 0.46,
"yEndFraction": 0.66,
"valueTemplate": "{{ package.label }}"
},
{
"description": "Tag number",
"elementType": "TEXT",
"xStartFraction": 0.05,
"xEndFraction": 0.95,
"yStartFraction": 0.38,
"yEndFraction": 0.45,
"valueTemplate": "{{ package.label | boldEndingDigits }}",
"paragraphFontName": "Helvetica",
"paragraphFontSize": 7,
"paragraphSpacing": 8,
"horizontalParagraphAlignment": "CENTER",
"paragraphTextResizeStrategy": "SHRINK_TEXT"
},
{
"description": "Logo",
"elementType": "IMAGE",
"xStartFraction": 0.25,
"xEndFraction": 0.75,
"yStartFraction": 0.84,
"yEndFraction": 0.98,
"valueTemplate": "{{ images['logo.png'] }}"
},
{
"description": "Product name",
"elementType": "TEXT",
"xStartFraction": 0.05,
"xEndFraction": 0.95,
"yStartFraction": 0.69,
"yEndFraction": 0.81,
"valueTemplate": "{{ package.item.name }}",
"paragraphFontName": "Helvetica-Bold",
"paragraphFontSize": 11,
"paragraphSpacing": 12,
"horizontalParagraphAlignment": "CENTER",
"paragraphTextResizeStrategy": "SHRINK_TEXT"
},
{
"description": "Potency",
"elementType": "TEXT",
"xStartFraction": 0.05,
"xEndFraction": 0.95,
"yStartFraction": 0.27,
"yEndFraction": 0.35,
"valueTemplate": "{{ package.metadata.indexedLabResults.totalTHC.full }}",
"paragraphFontName": "Helvetica-Bold",
"paragraphFontSize": 10,
"paragraphSpacing": 11,
"horizontalParagraphAlignment": "CENTER",
"paragraphTextResizeStrategy": "SHRINK_TEXT"
},
{
"description": "Lab results",
"elementType": "TABLE",
"xStartFraction": 0.1,
"xEndFraction": 0.9,
"yStartFraction": 0.14,
"yEndFraction": 0.27,
"valueTemplate": "<table><tbody>{% for key in ['totalTHC', 'totalCBD', 'CBG', 'totalTerpenes'] %}{% set entry = package.metadata.indexedLabResults[key] %}<tr><td><b>{{ entry.name }}</b></td><td>{{ entry.value }} {{ entry.unit }}</td></tr>{% endfor %}</tbody></table>",
"paragraphFontName": "Helvetica",
"paragraphFontSize": 7,
"paragraphSpacing": 8,
"paragraphTextResizeStrategy": "SHRINK_TEXT"
},
{
"description": "State warning",
"elementType": "TEXT",
"xStartFraction": 0.04,
"xEndFraction": 0.96,
"yStartFraction": 0.01,
"yEndFraction": 0.13,
"valueTemplate": "{{ t3.text.ca_cannabis_warning_disclosure }}",
"paragraphFontName": "Helvetica",
"paragraphFontSize": 5,
"paragraphSpacing": 5,
"horizontalParagraphAlignment": "LEFT",
"paragraphTextResizeStrategy": "SHRINK_TEXT"
}
]
}
Next Steps¶
- Something not rendering? See Troubleshooting.
- Back to step 8, Add the full lab panel.
- All tutorial steps
- Every built-in value: Built-In Data.