This allows the generation of a barcode via a fieldtype, variable or twig filter.

Barcode Options

All instances of barcode accept the following parameters:

  1. Code: number or alphanumeric depending on the barcode type.
  2. Format: svg or png (default: svg)
  3. Type: see below for all accepted types (default: EAN13)
  4. Width factor: this set with width factor of the bars (default: 2)
  5. Height: the in pixels of the bars (default: 30)
  6. Color: the hex value of the bars (default: '#000000')

Using Barcode

Twig variables:

    {{ craft.barcode.generate(123456789) }}

    {{ craft.barcode.generate(123456789, 'png', 'EAN13', 2, 30, '#000000') }}

Twig Filters:

    {{ 123456789|barcode }}

    {{ 123456789|barcode('png', 'EAN13', 2, 30, '#000000') }}

Free

Package Name

To install this plugin, search for its package name on the Plugin Store and click “Install”.


Information

  • Version 1.0.1
  • Last Update 2/25/2019
  • Active Installs 18
  • Compatibility Craft 3
  • License MIT
  • Categories Templating, Fields

Report an issue