webdna / barcode
Generate a barcode
Installs: 168
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 1
Open Issues: 0
Type:craft-plugin
Requires
- php: ^8.0.2|^9.0
- craftcms/cms: ^4.0.0
- picqer/php-barcode-generator: ^2.0.1
This package is auto-updated.
Last update: 2025-02-12 15:34:29 UTC
README
Generate a barcode
Requirements
This plugin requires Craft CMS 4.0.0 or later.
Installation
To install the plugin, follow these instructions.
- Open your terminal and go to your Craft project:
cd /path/to/project
- Then tell Composer to load the plugin:
composer require webdna/barcode
- In the Control Panel, go to Settings → Plugins and click the “Install” button for Barcode.
Barcode Overview
This allows the generation of a barcode via a fieldtype, variable or twig filter.
Barcode Options
All instances of barcode accept the following parameters:
- Code: number or alphanumeric depending on the barcode type.
- Format: svg or png (default: svg)
- Type: see below for all accepted types (default: EAN13)
- Width factor: this set with width factor of the bars (default: 2)
- Height: the in pixels of the bars (default: 30)
- 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') }}
Supported Barcode Types
Barcode Roadmap
Some things to do, and ideas for potential features:
- Release it
Brought to you by webdna