CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • EventBadges - how to create new badge templates or edit existing?
Pages: [1]

Author Topic: EventBadges - how to create new badge templates or edit existing?  (Read 2193 times)

Upperholme

  • Administrator
  • Ask me questions
  • *****
  • Posts: 568
  • Karma: 8
    • MC3
  • CiviCRM version: 4.x
  • CMS version: Drupal 6.x/7.x, Wordpress, Joomla
EventBadges - how to create new badge templates or edit existing?
January 15, 2015, 04:19:56 am
Any one aware of any decent information about how to do this?

As for the default options - does anyone know if they all print out on A4 sheets?

Just trying to avoid having to test them all out to see what happens. I have client looking at purchasing a label printer to be able to produce event badges at the event registration desk, so a format where 8 or 10 labels is printed up on an A4 sheet is not appropriate.
Graham Mitchell
http://mc3.coop

kasiawaka

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 4
    • Kasuwade Solutions Inc.
Re: EventBadges - how to create new badge templates or edit existing?
March 10, 2015, 09:37:51 am
Hi Grahame,
I discovered that the new badge templates in CiviCRM 4.5 can be added through Administer > System Settings > Option Groups > Name Badge Format (/civicrm/admin/options?gid=122&reset=1). Unfortunately, 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.

Here is what I did:
1. To know which value to update in the database, run first this query:
SELECT id FROM `civicrm_option_value` WHERE name = "Avery 5392"
where "Avery 5392" is the name of the new badge layout I just added. The result I got was 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.

3. Now, that new layout/template is available when adding new Event Badge Layouts (civicrm/admin/badgelayout?reset=1&action=browse)
Kasia Wakarecy
http://kasuwade.ca

Upperholme

  • Administrator
  • Ask me questions
  • *****
  • Posts: 568
  • Karma: 8
    • MC3
  • CiviCRM version: 4.x
  • CMS version: Drupal 6.x/7.x, Wordpress, Joomla
Re: EventBadges - how to create new badge templates or edit existing?
March 10, 2015, 09:56:34 am
Hi kasiawaka

Thanks for this.

Where did you get this from? Just trial and error and looking at what else was already in there?

What do these values refer to? NX: the number of labels across the page left to right? NY: the number from top to bottom? tMargin = top margin lMargin= left margin, others self explanatory.

Bit of a faff though, eh?

I'll add it into the documentation.
Graham Mitchell
http://mc3.coop

kasiawaka

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 4
    • Kasuwade Solutions Inc.
Re: EventBadges - how to create new badge templates or edit existing?
March 10, 2015, 10:25:02 am
Hi Grahame,
Yes, a bit of trial and error because I didn't find any decent documentation for 4.5 related to event badges. As to the values for that particular Avery 5392 template, I copied them from the old custom code I had access to (from the previous CiviCRM version) which we used in custom php file for custom badges (extending CRM_Event_Badge ). That is no longer an option in CiviCRM 4.5 due to the changes in code and how the badges are generated.
I haven't tested those values for Avery 5392 yet, I only got to the point of creating the new format to test during printing. Most likely some dimensions may need to be adjusted, I only used that as an example of adding new template.

It also helped to compare the built-in CiviCRM format for Avery 5395 with values: {"name":"Avery 5395","paper-size":"a4","metric":"mm","lMargin":15,"tMargin":26,"NX":2,"NY":4,"SpaceX":10,"SpaceY":5,"width":83,"height":57,"font-size":12,"orientation":"portrait","font-name":"helvetica","font-style":"","lPadding":3,"tPadding":3} to those specs (http://www.onlinelabels.com/Templates/OL5030-template-microsoft-word.htm) see what value correspond to what dimension. It was absolutely impossible to find the same information on Avery website.

So from my patched knowledge, the translation would be:
'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)

Kasia
Kasia Wakarecy
http://kasuwade.ca

kasiawaka

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 4
    • Kasuwade Solutions Inc.
Re: EventBadges - how to create new badge templates or edit existing?
March 10, 2015, 10:39:13 am
Actually, when comparing existing Label Formats from Administer > Communication > Label Formats (civicrm/admin/labelFormats?reset=1)
and edit any of the mailing labels, for example , Avery 5163 (civicrm/admin/labelFormats?action=update&id=407&group=label_format&reset=1) those labels and values are spelled out nicely (attached) so it should be easier to map the values for Event Name Badge formats.
Kasia Wakarecy
http://kasuwade.ca

Upperholme

  • Administrator
  • Ask me questions
  • *****
  • Posts: 568
  • Karma: 8
    • MC3
  • CiviCRM version: 4.x
  • CMS version: Drupal 6.x/7.x, Wordpress, Joomla
Re: EventBadges - how to create new badge templates or edit existing?
March 10, 2015, 01:19:01 pm
Wow, that's fantastically helpful, thank you. Armed with this I can get stuck in to making some new label formats for my sites and then, with a little experience under my belt I'll be able todo some work on the documentation for this.

Thanks again.
Graham
Graham Mitchell
http://mc3.coop

jsimonis

  • I post frequently
  • ***
  • Posts: 316
  • Karma: 4
    • Forward Support, Inc.
  • CiviCRM version: 4.4-4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5.37-cll
  • PHP version: 5.3.29
Re: EventBadges - how to create new badge templates or edit existing?
March 26, 2015, 02:16:33 am
I do wish we had more ability to do work in that area. One organization I work with prints out class lists and an index card for every student. What we're doing now is exporting the information and then doing a mail merge in Word to be able to print the information as needed. It's too bad it can't easily be done within CiviCRM. But for now we'll just continue using the mail merge. Thankfully once it's set up there isn't a lot of work needed unless there is a change in the information needed or something.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • EventBadges - how to create new badge templates or edit existing?

This forum was archived on 2017-11-26.