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 (Moderator: Dave Greenberg) »
  • Adding a Contact Directory to a Drupal page: Views, or...?
Pages: [1]

Author Topic: Adding a Contact Directory to a Drupal page: Views, or...?  (Read 911 times)

slamorte

  • I’m new here
  • *
  • Posts: 27
  • Karma: 1
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7
  • MySQL version: 14.14
  • PHP version: 5.4.4-14+deb7u8
Adding a Contact Directory to a Drupal page: Views, or...?
May 26, 2013, 06:45:05 am
Hi folks,

I'm new here and not sure if this is the best place to go for support, or where on the Forums to place my question. Let me know if there's a more appropriate place for this question.

I have a site with a complex membership. I have five or six pages where I need to appended contact info at the bottom of the pages. On the Staff Drupal page, I need to append at the bottom a list of all Staff names, primary emails, and primary phones. On Group A page, I need a list of Group A leaders with names, primary emails, and primary phones. On Group B page, I need a list of Group B leaders with names, primary emails, and primary phones. And so on.

It's not clear to me how to go about this and my researching is leading me in complex circles or require big time investments for directions that I'm not sure will lead to my goal.

Drupal Views seems like my best bet. I've experimented with Drupal Views with mixed results. I am able to do a View for either Users or CiviCRM Contacts. For there I am able to used Relationship A-to-B and Relationship: B fields to pull the correct contacts out of the CiviCRM database. But I can't limit this view to just Primary emails and phone; no matter how I structure it, I get one result per email or phone number for that contact.

* Putting CiviCRM Phone Details: Is Primary Phone (True) in the Filters Criteria has no effect on reducing duplicates results; somehow almost all contact phone numbers (work, fax, cell) are listed and Primary phone numbers, even though only one has the radio button checked in the contact card. 

* Putting CiviCRM Phone Details: Is Primary Phone with value "Yes" in the Contextual Filters removes all results.

If there's a way to fix the duplicates in Views, or if there's another path I should look into, I would greatly appreciate advice. Thanks.

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: Adding a Contact Directory to a Drupal page: Views, or...?
May 26, 2013, 12:27:55 pm
In the Field in the View, there should be a CiviCRM Location Settings (or similar) expandable item, which then lets you specify that the Field is restricted to eg Primary.
You don't mention that option above. Can you find it and does it do what you need?
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: Adding a Contact Directory to a Drupal page: Views, or...?
May 26, 2013, 12:29:26 pm
i suspect views is probably your best option for this w/o significant custom coding

however, u'll need to go in and debug and fix the views integration code so that it generates the right queries for is primary phone etc

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

slamorte

  • I’m new here
  • *
  • Posts: 27
  • Karma: 1
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7
  • MySQL version: 14.14
  • PHP version: 5.4.4-14+deb7u8
Re: Adding a Contact Directory to a Drupal page: Views, or...?
May 27, 2013, 07:20:08 am
Quote from: petednz on May 26, 2013, 12:27:55 pm
In the Field in the View, there should be a CiviCRM Location Settings (or similar) expandable item, which then lets you specify that the Field is restricted to eg Primary.
You don't mention that option above. Can you find it and does it do what you need?

Ah. I forgot to mention I experimented with this. Creating a View for Users or CiviCRM Contacts and adding CiviCRM Phone Details: Location Type to the View Fields causes a error of:
Quote
The handler for this item is broken or missing and cannot be used. If a module provided the handler and was disabled, re-enabling the module may restore it. Otherwise, you should probably delete this item.

I did have this work once, I think, but configuring it did nothing to address my issue as far as I can tell. I'll poke around and see what I did to get it to work.

Lobo, is that what you meant when you said I'd have to "debug and fix the views integration code?" That's right on the edge of my abilities if you have a link to some instructions.

slamorte

  • I’m new here
  • *
  • Posts: 27
  • Karma: 1
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7
  • MySQL version: 14.14
  • PHP version: 5.4.4-14+deb7u8
Re: Adding a Contact Directory to a Drupal page: Views, or...?
June 12, 2013, 01:40:03 pm
Bump

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Adding a Contact Directory to a Drupal page: Views, or...?

This forum was archived on 2017-11-26.