PHPackages                             scottboms/isbn-field - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. scottboms/isbn-field

ActiveKirby-plugin

scottboms/isbn-field
====================

ISBN Field Type plugin

1.1.1(9mo ago)10MITPHPPHP &gt;=8.1.1 &lt;8.4.0

Since Aug 3Pushed 4mo agoCompare

[ Source](https://github.com/scottboms/kirby-isbn-field)[ Packagist](https://packagist.org/packages/scottboms/isbn-field)[ Docs](https://github.com/scottboms/kirby-isbn-field)[ RSS](/packages/scottboms-isbn-field/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (5)Used By (0)

ISBN Field
==========

[](#isbn-field)

[![Plugin Preview](src/assets/isbn-field-preview.jpg)](src/assets/isbn-field-preview.jpg)

Adds an ISBN-10/ISBN-13 field type for Kirby including a rendered barcode preview of the code in the panel.

Installation
------------

[](#installation)

### [Kirby CLI](https://github.com/getkirby/cli)

[](#kirby-cli)

```
kirby plugin:install scottboms/isbn-field
```

### Git submodule

[](#git-submodule)

```
git submodule add https://github.com/scottboms/kirby-isbn-field.git site/plugins/isbn-field
```

### Copy and Paste

[](#copy-and-paste)

1. [Download](https://github.com/scottboms/kirby-isbn-field/archive/master.zip) the contents of this repository as Zip file.
2. Rename the extracted folder to `isbn-field` and copy it into the `site/plugins/` directory in your Kirby project.

Usage
-----

[](#usage)

### Blueprints

[](#blueprints)

In a Page blueprint, add a new field with the type `isbn`. The field supports numerous properties that control the rendered barcode preview in the panel and that map to the JsBarcode library that handles the preview.

```
  isbn:
    label: ISBN
    type: isbn
    height: 80
    font: monospace
    fontsize: 20
    textalign: center
    textposition: bottom
    margins: 10
    margintop: 0
    marginleft: 0
    marginbottom: 0
    marginright: 0
    displayvalue: true
    background: '#fff'
    linecolor: '#000'
    flat: false
    barwidth: 2
```

#### Field Properties

[](#field-properties)

NameTypeDefaultDescriptionheight`integer``80`Sets the height of the bars in the barcodefont`string``monospace`Sets text styling e.g. monospace, sans-serif, serif, fantasyfontsize`integer``20`Sets the font size up to a maximum of 20textalign`string``center`Sets text alignment for the text e.g. center, left, righttextposition`string``bottom`Set the vertical position of the text e.g. bottom, topmargins`integrer``0`Sets global margins around the rendered ISBN codemargintop`integer``null`Sets a top margin value onlymarginright`integer``null`Sets a right margin value onlymarginbottom`integer``null`Sets a bottom margin value onlymarginleft`integer``null`Sets a left margin value onlydisplayvalue`boolean``true`Turn the numeric value of the ISBN on or off e.g. true, falsebackground`string``#fff`Sets the background color of the ISBN previewlinecolor`string``#000`Sets the color of the lines and text of the ISBN previewflat`boolean``false`Removes error bars from the rendered ISBN### Using in Templates

[](#using-in-templates)

To output the simple text value of the field:

```

```

Or utilize the toIsbn() field method and pass 'svg' or 'html' and output an SVG or HTML representation of the code. Pass 'text' to output the raw field value.

```
