Step 6: Name the product¶
The barcode already pulls from the package record. Now put the product name on the label the same way.
- Add a Text layer and set its Layer description to
Product name. - Drag it into a band between the logo and the barcode:
X: 5% – 95%,Y: 19% – 31%. - Set Value template to
{{ package.item.name }}. - Set Font Size to
11and Resize Strategy toShrink Text. - Make it bold: open Current layout JSON at the bottom of the tab, find the
Product namelayer, and change its"paragraphFontName"from"Helvetica"to"Helvetica-Bold".
package.item.namereaches one level deeper thanpackage.label. The item is a nested record on the package, so you walk to it with a dot. Anything Metrc stores on the package is reachable the same way.The Font dropdown offers only the three base families. Bold, italic and oblique variants are set in the JSON, and Text Formatting lists every name.
Product names vary in length, which is exactly when
Shrink Textearns its keep. Compare the longest and shortest names below: both fit their box.
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"
}
]
}
Next Steps¶
- Continue to step 7, Add the THC result.
- Back to step 5, Add your logo.
- All tutorial steps