5

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.

Thanks

3 Answers 3

3

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.

1
  • 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
    Commented Sep 2, 2020 at 5:13
6

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)
4
  • 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
    Commented Apr 18, 2016 at 19:22
  • Nice idea, here you are.
    – diegov
    Commented Apr 18, 2016 at 23:30
  • Has anyone used this in CiviCRM 4.7? Doesn't seem to work for me.
    – bgm
    Commented 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
    Commented Aug 22, 2017 at 15:43
2

There is an even simpler way to add a name badge format. Just create a normal mailing label format and then copy it to a new name badge format.

  1. Go to Administer - Communications - Label Formats
  2. Add a label format with all the dimensions you need for your name badges and save.
  3. Go to Administer - System Settings - Option Groups and select Edit Options for Mailing Label Format.
  4. Copy the value of the new label format you just created.
  5. Return to Option Groups, but this time select Edit Options for Name Badge Format.
  6. Add a new Name Badge Format, paste in the value and add a name.
  7. You can now go back to Administer - Communications - Label Formats and delete the label you created as it was just temporary to copy.
  8. Now go to Admin - CiviEvent - Event Name Badge Layout to set up your the fields on your name badges.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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