Civi offers four default Event Name Badges, but we need something different (same size as an Avery L4727 label). Can anyone direct me to how to add a custom name badge? We're using Civi 4.6.15.


2 Answers 2


We're using 4.7.8 and can do this without having to enter it directly into the database.

If you go to Administer > System Settings > Option Groups > Name Badge Format and add a new name badge format you can enter the values you want in the value field. eg {"paper-size":"a4","orientation":"portrait","font-name":"times","font-size":6,"font-style":"","NX":2,"NY":4,"metric":"mm","lMargin":6,"tMargin":19,"SpaceX":0,"SpaceY":0,"width":100,"height":65,"lPadding":0,"tPadding":0}

Then you can adjust those details for your requirements and the settings will be available for your badge layouts.

  • i think there is an extra bit of the answer that may help others, namely then setting up the event badge via Admin > CiviEvent> Event Name Badge Layout at /civicrm/admin/badgelayout?action=update&id=1&reset=1
    – petednz - fuzion
    Sep 2, 2020 at 5:13

It's not very strait forward, but here are the steps needs, (credit to Kasia Wakarecy) as commented in the old CiviCRM forum (https://forum.civicrm.org/index.php?topic=35420.0):

The new badge templates can be added through Administer > System Settings > Option Groups > Name Badge Format. That interface only allows to enter the new badge name and a description but no info about the layout. To actually tell CiviCRM some details about that badge layout, direct database update is required to add that value:

  1. To know which value to update in the database, run first this query:
    SELECT id FROMcivicrm_option_valueWHERE name = "Avery 5392"
    where "Avery 5392" is the name of the new badge layout you just added. The result is going to be like id = 847.

  2. Enter the layout details for that badge into the DB using this query:
    UPDATE civicrm_option_value SET value = '{"name":"Avery 5392","paper-size":"letter","metric":"mm","lMargin":2,"tMargin":25.4,"NX":2,"NY":3,"SpaceX":0,"SpaceY":0,"width":101.6,"height":76.2,"font-size":12,"orientation":"portrait","font-name":"helvetica","font-style":"","lPadding":3,"tPadding":3}' WHERE `civicrm_option_value`.`id` = 847;

Update the id = 847 with the id number from the first query.

The fields above mean:

'name' => '5395' // name of label
'paper-size' => 'a4' // paper size
'metric' => 'mm' // units
'lMargin' => 15 // left margin in mm (because metric = mm)
'tMargin' => 26 // top margin in mm (because metric = mm)
'NX' => 2 // number of items in x (left to right) direction
'NY' => 4 // number of items in y (top to bottom) direction
'SpaceX' => 10 // spacing between items in x (left to right) direction in mm (because metric = mm)
'SpaceY' => 5 // spacing between items in y (top to bottom) direction in mm (because metric = mm)
'width' => 83 // width of one item in mm (because metric = mm)
'height' => 57 // height of one item in mm (because metric = mm)
'font-size' => 12 // font size
'lPadding' => 3 // left padding in mm (because metric = mm)
'tPadding => 3 // top padding in mm (because metric = mm)
  1. Now, that new layout/template is available when adding new Event Badge Layouts (civicrm/admin/badgelayout?reset=1&action=browse)
  • 2
    nice find. do you want to copy the crux of it over here so that your Answer becomes the 'go to' place?
    – petednz - fuzion
    Apr 18, 2016 at 19:22
  • Nice idea, here you are.
    – diegov
    Apr 18, 2016 at 23:30
  • Has anyone used this in CiviCRM 4.7? Doesn't seem to work for me.
    – bgm
    Aug 22, 2017 at 15:18
  • Going through /civicrm/admin/labelFormats seems to work (although I had to change the option_group_id manually, to set it in the right group).
    – bgm
    Aug 22, 2017 at 15:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.