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
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.
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:
To know which value to update in the database, run first this query:
SELECT id FROM
civicrm_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.
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)
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.