Labels in Koha

Labels in Koha

There are a number of options for creating labels in Koha.

Label Creator

Koha's label creator tool will allow libraries to use layouts and templates that will assist in the creation to print spine labels and barcodes. A library can create customized label layouts, and custom label templates. A single label or a batch of labels can be printed out using a designed layout and template.

A step-by-step guide to both the creation of the template and layout can be found in the Koha Manual.

Templates

Our Koha partners will have two templates built into the Koha system, a generic barcode label and one for spine labels. If your library does need to add a new template to Koha, the best advice we can give is to Google the brand and associated number for your label. Most of the information in the Template form within Koha can be found from the label provider and then the information is simply put in the boxes.


Label Layout

The layout is where a library can determine what lives on the label! There is no limit to the number of layouts (or templates) that a library can have in Koha.

Within the layout, a library can assign specific item fields and specific MARC fields that will be printed out on the label. Font, justification, and size will also be determined on the layout form.


Splitting Call Numbers

What If I don't click split call numbers checkbox in the layout section of the lay creator in the cataloging module?

If you do not click the split call numbers check box, the call numbers will not split. In the screenshot below you will see the first example were the checkbox is checked to split and the second which is not checked.


Label Maker Plugin

A member of the development team with Bywater Solutions, Kyle Hall, created a new plugin to help solve some of the more complex label questions/situations that libraries may have. The original idea behind the plugin was to deal with the dilemma of a multi-type label document. This would be the sheets of labels that include maybe a spine label but also have another size for the barcode or faceplate for the book.

Since this is a plugin for Koha, a library will need to download the plugin from the ByWater Github site and install it in Administration > Manage Plugins. If you are a ByWater partner and would like assistance on going through the process, please submit a ticket, we are always happy to help.

The creation of the Label Plugin was to alleviate some of the limitations that Koha's Label Creator had.
  1. Creation of multi-sized labels on an individual sheet
  2. Flexibility is spacing within the label
  3. Flexibility in splitting call numbers
  4. The ability to edit labels prior to printing
  5. Additional fonts
  6. Ability to use CSS for styling of the labels
By default, the label plugin has two types of labels that are commonly used outside of the label creator. The defaults will also allow users to easily modify specific areas given a type of template within the default.

Features of the Plugin

Once this plugin has been installed, any/all plugins installed on your Koha system will appear in the Administration module under plugins.

To use this plugin use the Action button to Run.

The plugin will have three tabs that are labeled, Templates, Layouts and Printer Profiles. In addition, there is the ability to create new templates, new layouts, new printer profiles, and new label batches. A Label Wizard is also available that has been designed to help the library create a new layout or template with help.

The template will determine what will be printed on the label and the layout will be the size and dimensions of the sheet and specific label/s.

Both templates and layouts have two types of labels already setup with this plugin.
The layouts that are included:

  1. Avery label sheet 5630
  2. Basix 55-459-007
The Avery label is a basic size barcode label and the Basix is the multi-size label sheet as was described above.

The templates that are included:
  1. Avery Standard has the Title, Barcode, and Item Number
  2. Basix has the Title on one small label, title, and barcode on other two labels.
Below are the images of what the pre-defined labels will print out as. The Red, Green and Blue label picture is using the Basix template and layout. The other image is using the Avery Label and template.



Label Batches

Batches in the Label Maker Plugin come from the Batches that have been created in the Label Creator found under the Tools section in Koha. Any batch that has been created there, can be used in the Label Maker Plugin. Each batch is given a number by Koha and the number found in parenthesis is the number of items in the batch. To print your labels, you will use choose the "Print Batch" option.

Editing the Layout

The layout is set up for the size of the label and sheet, but also for the type of font used and color. The Basix layout that comes with the plugin includes color to each set of labels, to make it easier to determine which to edit. However, when you are ready to print your labels, you probably won't want them in color!

Jessie showed us how to remove the color from the layout, by removing the line :

background-color: red;


But remember, we emphasized to make a copy of the layout (and also can be done in templates also) first! To make a copy of the layout is found under the actions, and is super handy to do!


The next step is editing the font. If there is no Font listed on the layout, then it will print in Times New Roman. However, a font can be easily added or changed in the layout.

Jessie walked through adding the font of Verdana to the layout right under the body/width section:


A little bit more detail about the structure of the layout:

Here you can see a few details to be aware of (however if you have used the label creator, it's the same information, but presented in a different way)
  1. This is the size of the paper.
  2. This is the padding around the paper before the label begins. So measurements of the top and left hand side of paper.
  3. The size of the label itself: width, height, and margin of labels.
  4. How to display the text, in this example it is in the center.
Below there is a comment field that it includes a dotted line to show on a test where the labels live on the screen.
Below are images of both the Avery Layout and the Basix Layout- more layouts are listed on the Basix because unlike the Avery, the Basix layout has the dimensions for three labels.


In the Basix layout displayed below, there is a little bit of code at the top and the bottom that this image does not display due to the largeness of the screenshot. Both 1 & 2 are the construction of the sheet itself. This is the page and padding of their physical sheet of labels. Number 3 is the dimensions of the left side label, including formatting of text and the color of the label which can be removed. Number 4 is the dimensions of the center label, including the formatting of the text (such as center) and the color of the label which can be removed.

Editing the Template

Libraries use a variety of information on their spine labels, barcodes, etc. To edit this information, this can be done in the label template.

Jessie walked through the steps of removing the title from the template and replacing it with the item call number.


Looking closely at the Avery Template (there is a place to see all the code), you can see what details are included in this template: title, barcode, itemnumber

  1. If editing is desired to change this particular template, there is an action button over to the right which can bring up the option to edit, copy or delete. I have always been a fan of COPY if given the option as there is in Koha reports- so as to not lose the template the works! Editing will open up this same page, but give the user the ability to adjust the code.
  2. If copy is chosen from the action menu, the template will be duplicated. Remember to give your template a new name, as to not mix them up.
  3. Another option as opposed to editing this from here, there is the ability to create a new template using the Label Wizard* at the top of this page. The wizard will do the heavy lifting (or in the case the detailed coding).

Now let’s look at the next template- the multi-size label sheet. Same principles as above - this template can be edited, copied or deleted. Let’s look more closely at this template and what it will display from what is in the template:


Splitting Call Numbers

Jessie asked a great question about call number splitting! Thank goodness we had an expert web designer on the video with us! Lucas does have a way to split the call number a space or a period. However, if you are a partner of Bywater Solutions and need assistance with this, please submit a ticket! Lucas is happy to help. Here is the code that he added to the template that needed the call number split:

$(document).ready(function () {
$('.label').each(function() {
let theText = $(this).text();
let theNewText = theText.trim().replace(/\s+/g, '
').replace('.' , '
.');
$(this).html(theNewText);
})
});

This code was added into the template- here is a look at the entire code of the template to get a better understanding of where it goes:

[% FOREACH item IN items %]
[% IF loop.index % 1 == 0 %]
[% SET label_index = 1 %]
[% UNLESS loop.first %]

[% END %]

[% END %]

[% item.marc.subfield('949','a') %]

[% IF loop.last %][% END %]
[% SET label_index = label_index + 1 %]
[% END %]


$(document).ready(function () {
$('.label').each(function() {
let theText = $(this).text();
let theNewText = theText.trim().replace(/\s+/g, '
').replace('.' , '
.');
$(this).html(theNewText);
})
});

Tutorial



Troubleshooting call number splitting for labels

LCC call number splitting

Libraries love to personalize their LCC call numbers. Sometimes they add "Ref" or something to the start of the number. Sometimes they don't put a space between the first block of letters and the first block of numbers. So they may have a call number like:

REF PN6728.B36 M55 1989

Which makes total sense, but confuses Koha's LCC splitting routine.

Go to Admin > Classification Sources and create a new splitting rule. Tell your new rule you want to define splitting behavior via regex. This regex will leave the legacy call numbers as-is in the database but transform it a bit when putting it on a label. For the example above, we need to do three things:

  • Put in a space in between "PN" and "6728"
  • Put a space before the . in ".B36"
  • Replace all spaces with line breaks

  • That's going to mean three bits of regex:
    1. s/([a-zA-Z]+)(\d+)/\1 \2/  -- Finds the first spot in the call number where a letter abuts a number and puts a space between them
    2. s/([a-zA-Z\d])\./\1 ./ -- Finds the first spot in the call number where a letter or number abuts a . and puts a space between them
    3. s/\s/\n/g -- Replaces all spaces with line breaks
    So the example call number becomes:

    REF
    PN
    6728
    .B36
    M55
    1989

    These will surely need some tweaking library-to-library to accommodate each partner's variations, but that's the general idea.

    Print a Range of Barcode Labels

    Libraries can print a range of barcodes from the Label Creator in Koha.

    Printing a Range of Barcodes

    In the label creator (under Cataloging), there is an option under the dropdown menu that will allow libraries to print a range of barcodes. Koha will then prompt for a beginning barcode number and an end barcode number to print.

    Next choose the layout and template for the barcode and the label number to start printing on the page. For example, if there were already printed labels used off of the label sheet, Koha does give you an option to start printing in another position than that of the 1st label in the sheet.



    Then the label sheet can be downloaded as a PDF and printed by the library.



      • Related Articles

      • Paypal Plugin for Koha

        PayPal Setup The steps below will walk you through setting up the PayPal business account. PayPal Business Account Set-Up: Log into your PayPal business account. Go to the Tools dropdown menu and select 'All Tools'. Choose Integrate API on the left ...
      • Batch Search Plugin for Koha

        The Batch Search plugin can perform a batch ISBN search in Koha. Batch Search Plugin The first step is to install the Batch Search plugin. Then, in Administration > Manage plugins, you will click the Actions button for this plugin and select "Run the ...
      • Scanned Barcode Prefixer Plugin for Koha

        The Scanned Barcode Prefixer plugin allows libraries to automatically create and read prefixed barcodes - both for patron and item barcodes. For patron or item creation, the plugin automatically adds digits to the beginning of the card number or ...
      • Patron Passport Plugin for Koha

        This plugin is available on the ByWater Solutions GitHub site, and currently needs to be configured by a ByWater team member. The plugin configuration does not live in the staff interface, but on the backend where it is not accessible to partners. ...
      • Authorities in Koha

        Koha has a number of ways of managing Authority Records. Here are a few options. How Can I Identify Unused Authorities? If you'd like to do some authorities clean-up and want to start with identifying authorities with no bibliographic records ...