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 Drupal Modules (Moderator: Donald Lobo) »
  • Views integration value/labels (again - this time with an example)
Pages: [1]

Author Topic: Views integration value/labels (again - this time with an example)  (Read 3984 times)

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Views integration value/labels (again - this time with an example)
July 22, 2009, 12:35:36 am
Hi there,

This is a follow up to this post (http://forum.civicrm.org/index.php/topic,8411.0.html) this time with an example.

I'm not using custom data this time, but the principle is the same.

I'm using views to display various bits of data in Drupal.  One view provides a nicely themed (though depending on when you look at this, the theme might not be applied) categorised look at upcoming training. http://database.vawcvs.org/training

I've used event type as an argument in views to categorise events by type.  There is a menu on the right hand side to navigate through these types.  The problem is that the title of the page uses the event type value, not the event type label, so I get. 'Training - 6' instead of 'Training - funding'

How do I get it to display the actual label rather than the value?

Thanks a billion,
Michael
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

DanilaD

  • I post occasionally
  • **
  • Posts: 93
  • Karma: 11
Re: Views integration value/labels (again - this time with an example)
July 22, 2009, 08:19:43 am
Hello, Michael.

I expect you will need to write custom handlers for those cases, as current views integration code does not support 'labels' for values stored in database. This is similar to the countries issue here: http://issues.civicrm.org/jira/browse/CRM-4221, where views show numeric IDs instead of country names.

Depending on your urgency, you have three possible ways to deal with this problem:

- dig into views integration code yourself, and write the necessary custom handlers for those cases;
- hire some professionals working with CiviCRM to do so;
- wait until someone who needs this more than you makes it.

All necessary code sits in civicrm\drupal\modules\views on your site.

Regards,
Danila

DanilaD

  • I post occasionally
  • **
  • Posts: 93
  • Karma: 11
Re: Views integration value/labels (again - this time with an example)
July 22, 2009, 08:29:34 am
You may join forces with mariagwyn, who reports similar problems with labels-checkboxes-multiselects here:

http://forum.civicrm.org/index.php/topic,8803.0.html

I think proper solution of one of this problems will solve another.

Regards,
Danila

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Views integration value/labels (again - this time with an example)
July 22, 2009, 10:16:32 am
Thanks for the info Danila,

If and when I get a mo, I'll try and dig in myself and let you know how I get on.

Michael
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

jalama

  • I post frequently
  • ***
  • Posts: 176
  • Karma: 22
    • Rooty Hollow LLC
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6 and 7
  • MySQL version: 5.1
  • PHP version: 5.2.5 and 5.3
Re: Views integration value/labels (again - this time with an example)
July 31, 2009, 07:44:32 am
Hey Michael,

Yea it's definitely a custom handler.  Civi methods built in that deal with this for built in select field, though not for custom fields so it pull directly from the database.

Jim
http://www.rootyhollow.com

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Views integration value/labels (again - this time with an example)
August 13, 2009, 10:22:23 pm
Is it also a custom handler issue fact that for a single option checkbox (ie tick the box for YES) the data coming in through Views includes the 'CTRL+A "boxes"' (as Dave seems to refer to them here http://forum.civicrm.org/index.php/topic,9079.msg39146.html#msg39146 ie small boxes with 0s and 1s

see image below
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Views integration value/labels (again - this time with an example)
August 14, 2009, 05:46:41 am

yes

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

mariagwyn

  • I post frequently
  • ***
  • Posts: 149
  • Karma: 4
  • CiviCRM version: CiviCRM 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.2.14
  • PHP version: 5.0.91-50-log
Re: Views integration value/labels (again - this time with an example)
December 24, 2009, 09:20:10 am
Any progress on this?  I am working on a custom handler to deal with the multi-select issue (http://forum.civicrm.org/index.php/topic,8803.0.html), though it turns out that the real problem is that civi stores multi-select as a string in the data itself.  If these issues are related, any solution on this side would help immensely.  I will post the code once it is done, though I am still working on 2.2.9.

DerekL

  • I post frequently
  • ***
  • Posts: 132
  • Karma: 1
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.54
  • PHP version: 5.2.17
Re: Views integration value/labels (again - this time with an example)
December 12, 2011, 11:58:37 pm
Hmmm.

I'm seeing the same issue in Civi4.1alpha2.

State and Country, at the least.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Views integration value/labels (again - this time with an example)

This forum was archived on 2017-11-26.