Aller directement à la fin des métadonnées
Aller au début des métadonnées


Documentation Search


CiviCRM 4.1 Documentation

Developer Resources


CiviCRM books!

Make sure to check out our Online User/Administrator and Developer Guides! You can also support this project by ordering a hard copy.

Or support us by buying an eBook or hard copy of Using CiviCRM from Packt Publishing.

The simpliest, and easiest, configuration on the badges is to change the background image (by default, it's a civicrm logo).

To do that, you simply have to set up a custom template directory, and add a logo (png format) in the directory templates/CRM/Event/Badge/CRM_Event_Badge_Logo.png or /CRM/Event/Badge/CRM_Event_Badge_NameTent.png (respectively for the Logo or name tent format).

You can also set a specific logo for a specific event by putting the logo into templates/CRM/Event/Badge/[event id]/[class name].png

eg for the Logo format of the event number 42, simply put the image  templates/CRM/Event/Badge/42/CRM_Event_Badge_Logo.png

You might want to create a new format, simply go to the admin (http://sandbox.civicrm.org/civicrm/admin/options/event_badge?group=event_badge&reset=1) and create a new event badge.

You will have to provide a class that formats each badge. For instance, the Logo template CRM/Event/Badge/Logo.php contains two methods: the constuctor, that mostly sets the format of the page (how many badges per page), and generateLabels, that format each label.

$participant contains the datas about the participant (name, oganization, role...)

The above code needs to be saved in a new PHP file named the same as the class name, minus "CRM_Event_Badge_". So if your new class is named "CRM_Event_Badge_Custom", save Custom.php in <custom PHP directory>/CRM/Event/Badge. The custom PHP directory is set in Global Settings > Directories.

Any custom logo files for your new class need to be named Custom.png and saved in <custom template directory>/CRM/Event/Badge.

If you create a new format, please share it with the community and add it as a sub page below.

In theory, you can use a jpg or gif format. It did work much better with png in my case, YMMV.

Community Submitted Name Badge Formats

The following is a list of community submitted name badge format files which can be implemented using the directions above.

4"x3" 6-up Badges

Download the format file .

Constructs participant name badges with following dimensions: 4"x3" badges 6 per page 1" top margin 0.25" left/right margin 0" bottom margin letter size page
Constructs participant name badges with following dimensions:

  • 4"x3" badges
  • 6 per page
  • 1" top margin
  • 0.25" left/right margin
  • 0" bottom margin
  • letter size page

Badge contains display name, job title, and organization on three lines. The font size is set based on the length of each string (four tiers). Display name has leading/trailing/double spaces removed. You can swap out the display name for the full name (first + last) by replacing $display_name with $full_name in lines 60-64. You will need to register the class in the system using the directions above (CRM_Event_Badge_NameTitleOrg4x3).

Étiquette