cobi.wms:label_templates
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| cobi.wms:label_templates [2022/11/16 11:08] – [File 2] tkammer | cobi.wms:label_templates [2023/06/19 13:59] (current) – tkammer | ||
|---|---|---|---|
| Line 90: | Line 90: | ||
| | '' | | '' | ||
| | '' | | '' | ||
| + | ^ Warehouse-level ^^ | ||
| + | | '' | ||
| + | | '' | ||
| ^ Bin location-level ^^ | ^ Bin location-level ^^ | ||
| | '' | | '' | ||
| Line 174: | Line 177: | ||
| </ | </ | ||
| - | In this example, the first GS1 barcode field is '' | + | In this example, the first GS1 barcode field is '' |
| - | The next field is '' | + | The next field is '' |
| Here's a list of commonly used GS1 field identifiers: | Here's a list of commonly used GS1 field identifiers: | ||
| Line 188: | Line 191: | ||
| === Better control of generated HTML === | === Better control of generated HTML === | ||
| - | The '' | + | The '' |
| + | |||
| + | The '' | ||
| + | |||
| + | < | ||
| + | <img id=' | ||
| + | </ | ||
| + | |||
| + | The '' | ||
| < | < | ||
| - | <img id=' | + | <img id=' |
| </ | </ | ||
| - | The parameters of the '' | + | The parameters of the '' |
| ==== User-input values ==== | ==== User-input values ==== | ||
| Line 275: | Line 286: | ||
| </ | </ | ||
| - | **NOTE:** Don't put any spaces before or after the parentheses or the separating | + | **NOTE:** Don't put any spaces before or after the parentheses or the separating |
| - | This placeholder uses the pipe symbol instead of commas to separate its parameters, because the parameters themselves may contain commas. | + | This placeholder uses the vertical bar symbol instead of commas to separate its parameters, because the parameters themselves may contain commas. |
| The mechanism is as follows: the text found within the '' | The mechanism is as follows: the text found within the '' | ||
| Line 325: | Line 336: | ||
| </ | </ | ||
| - | ====== Example template files ====== | + | ===== Example template files ===== |
| The following example files serve to demonstrate the syntax and some of the features. | The following example files serve to demonstrate the syntax and some of the features. | ||
| - | ===== File 1 ===== | + | ==== File 1 ==== |
| This is a very simple template demonstrating the use of placeholders to print the item code and name, price, and a timestamp. | This is a very simple template demonstrating the use of placeholders to print the item code and name, price, and a timestamp. | ||
| Line 351: | Line 362: | ||
| } | } | ||
| - | /* Don' | + | |
| - | html, body { | + | |
| - | width: | + | work with ZPL printing, so repeat the page dimensions explicitly. |
| - | height: | + | use standardized sizes like A6 here. The height should be minimally reduced to make |
| + | | ||
| + | width: | ||
| + | height: | ||
| + | |||
| + | /* Don't change, use the container below. */ | ||
| margin: 0; | margin: 0; | ||
| padding: 0; | padding: 0; | ||
| + | |||
| + | /* Useful to diagnose dimension issues. */ | ||
| + | outline: 0.5mm solid black; | ||
| + | outline-offset: | ||
| } | } | ||
| .container { | .container { | ||
| + | /* Don't change. */ | ||
| box-sizing: border-box; | box-sizing: border-box; | ||
| + | position: relative; | ||
| width: 100%; | width: 100%; | ||
| height: 100%; | height: 100%; | ||
| font-family: | font-family: | ||
| - | font-size: | + | font-size: |
| /* Global padding from the edges. */ | /* Global padding from the edges. */ | ||
| Line 375: | Line 397: | ||
| <div class=" | <div class=" | ||
| - | <div style=" | + | |
| - | < | + | < |
| - | </ | + | </ |
| - | <div style=" | + | |
| - | < | + | < |
| - | </ | + | </ |
| - | <div style=" | + | |
| - | @itemName@ | + | @itemName@ |
| - | </ | + | </ |
| - | <div style=" | + | <div style=" |
| - | @barcode(CODE_128, | + | @barcode(CODE_128, |
| - | </ | + | </ |
| - | <div style=" | + | <div style=" |
| - | (90)@itemCode@(10)@batchNumber@ | + | (90)@itemCode@(10)@batchNumber@ |
| - | </ | + | </ |
| - | <div style=" | + | |
| - | < | + | < |
| - | </ | + | </ |
| - | <div style=" | + | |
| - | < | + | < |
| - | </ | + | </ |
| </ | </ | ||
| Line 406: | Line 428: | ||
| </ | </ | ||
| - | ===== File 2 ===== | + | ==== File 2 ==== |
| This file demonstrates the use of user-input values and JavaScript integration. | This file demonstrates the use of user-input values and JavaScript integration. | ||
| Line 428: | Line 450: | ||
| } | } | ||
| - | /* Don' | + | |
| - | html, body { | + | |
| - | width: | + | work with ZPL printing, so repeat the page dimensions explicitly. |
| - | height: | + | use standardized sizes like A6 here. The height should be minimally reduced to make |
| + | | ||
| + | width: | ||
| + | height: | ||
| + | |||
| + | /* Don't change, use the container below. */ | ||
| margin: 0; | margin: 0; | ||
| padding: 0; | padding: 0; | ||
| + | |||
| + | /* Useful to diagnose dimension issues. */ | ||
| + | outline: 0.5mm solid black; | ||
| + | outline-offset: | ||
| } | } | ||
| .container { | .container { | ||
| + | /* Don't change. */ | ||
| box-sizing: border-box; | box-sizing: border-box; | ||
| + | position: relative; | ||
| width: 100%; | width: 100%; | ||
| height: 100%; | height: 100%; | ||
| font-family: | font-family: | ||
| - | font-size: | + | font-size: |
| /* Global padding from the edges. */ | /* Global padding from the edges. */ | ||
| Line 448: | Line 481: | ||
| } | } | ||
| </ | </ | ||
| - | <!-- Input definitions: | ||
| + | <!-- Input definitions: | ||
| @input(text[Insert value])@ | @input(text[Insert value])@ | ||
| @input(selection[Select value]; | @input(selection[Select value]; | ||
| @input(codeFormat[Barcode type]; | @input(codeFormat[Barcode type]; | ||
| - | |||
| --> | --> | ||
| - | <!-- @useJavaScript@ --> | ||
| < | < | ||
| + | // @useJavaScript@ | ||
| window.onload = function() { | window.onload = function() { | ||
| var insert = document.getElementById(' | var insert = document.getElementById(' | ||
| insert.textContent = "Hello World!" | insert.textContent = "Hello World!" | ||
| - | | + | cobiwms.print() |
| } | } | ||
| </ | </ | ||
| Line 468: | Line 500: | ||
| <div class=" | <div class=" | ||
| - | <div style=" | + | |
| - | < | + | < |
| - | </ | + | </ |
| - | <div style=" | + | |
| - | < | + | < |
| - | </ | + | </ |
| - | <div style=" | + | |
| - | @itemName@ | + | @itemName@ |
| - | </ | + | </ |
| - | <div style=" | + | <div style=" |
| - | @barcode(@input(codeFormat)@, | + | @barcode(@input(codeFormat)@, |
| - | </ | + | </ |
| - | <div style=" | + | <div style=" |
| - | (90)@itemCode@(10)@batchNumber@ | + | (90)@itemCode@(10)@batchNumber@ |
| - | </ | + | </ |
| - | <div style=" | + | |
| - | < | + | < |
| - | </ | + | </ |
| - | <div style=" | + | |
| - | < | + | < |
| - | </ | + | </ |
| </ | </ | ||
cobi.wms/label_templates.1668593331.txt.gz · Last modified: by tkammer