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) »
  • how to use drupal views to access civicrm contact's image
Pages: [1]

Author Topic: how to use drupal views to access civicrm contact's image  (Read 3354 times)

kennedy

  • I post occasionally
  • **
  • Posts: 119
  • Karma: 5
  • CiviCRM version: 4.5.5
  • CMS version: Drupal
  • PHP version: 5.3.10
how to use drupal views to access civicrm contact's image
April 01, 2014, 01:21:21 pm
How can I use views in drupal to access civicrm contact's image instead of the image url?
Is there also any way to access attachments in civicrm using views in drupal?

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: how to use drupal views to access civicrm contact's image
April 01, 2014, 01:23:32 pm
Can you pls detail what you have already tried so we don't spend time explaining about eggs and sucking ;-)
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

kennedy

  • I post occasionally
  • **
  • Posts: 119
  • Karma: 5
  • CiviCRM version: 4.5.5
  • CMS version: Drupal
  • PHP version: 5.3.10
Re: how to use drupal views to access civicrm contact's image
April 01, 2014, 02:11:59 pm
OK, I have a view and i wish to list some contact details from my civicrm db with their pictures. I have created a view of type civicrm contacts, but the image field shows but the image url. I will like to display the contact's image instead alongside his/her contacts details.

Also i have some customs fields in civicrm for file attachment, is there anyway i can display the files using views?

thank you in advance!
« Last Edit: April 02, 2014, 05:55:24 am by kennedy »

jseroskie

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 4.4.3
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.34-cll
  • PHP version: 5.4.15
Re: how to use drupal views to access civicrm contact's image
April 11, 2014, 10:55:48 pm
I have the same problem. I would like to display contact images in a Drupal view.... I get only the URL to the image when using a custom field of FILE type.

"I have a view and i wish to list some contact details from my civicrm db with their pictures. I have created a view of type civicrm contacts, but the image field shows but the image url. I will like to display the contact's image instead alongside his/her contacts details."
Jim Seroskie
Guild of NH Woodworkers

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: how to use drupal views to access civicrm contact's image
April 11, 2014, 11:14:41 pm
have you tried anything on the Field such as using Rewrite Results on Image URL field and set the text to eg
<img src="[image_URL]">
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

kennedy

  • I post occasionally
  • **
  • Posts: 119
  • Karma: 5
  • CiviCRM version: 4.5.5
  • CMS version: Drupal
  • PHP version: 5.3.10
Re: how to use drupal views to access civicrm contact's image
June 12, 2014, 12:41:32 pm
thanks Pete!

groston

  • I post occasionally
  • **
  • Posts: 61
  • Karma: 0
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.5.34
  • PHP version: 5.3.27
Re: how to use drupal views to access civicrm contact's image
June 25, 2014, 08:05:27 pm
Pete's advice, as usual is spot on.

One thing that threw me, but luckily not for too terribly long, is that with this approach, one does not have access to the Drupal Image Style functionality. This concerned me as I need to display images, which are natively different sizes, as being the same approximate size.

What I found is that the following works: <img src="[image_URL]" width="250 px">

vantuykom

  • I post occasionally
  • **
  • Posts: 49
  • Karma: 0
  • CiviCRM version: 4
  • CMS version: drupal
  • MySQL version: 5
  • PHP version: 5.3
Re: how to use drupal views to access civicrm contact's image
August 01, 2014, 06:16:47 am
I can not display the image this way, there is a permission issue but my permissions allow everyone to access uploaded files...

What am I doing wrong?

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: how to use drupal views to access civicrm contact's image
September 07, 2014, 05:02:43 pm
Quote from: groston on June 25, 2014, 08:05:27 pm
What I found is that the following works: <img src="[image_URL]" width="250 px">
I concur in terms of using width approach v using 'style'. Thanks for posting this back
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

zkrebs

  • I post occasionally
  • **
  • Posts: 69
  • Karma: 1
Re: how to use drupal views to access civicrm contact's image
January 26, 2015, 01:04:12 pm
It would be great if CiviCRM could store images that linked into Drupal image styles functionality.

What if I want to do a responsive slideshow of images for the organizations in my DB?
I guess I could store the Pictures as a Drupal node, link the node to the Civi record (civicrm entity?) and then have the view(s) display them?

Lots of thoughts.

linkx

  • I post occasionally
  • **
  • Posts: 86
  • Karma: 7
Re: how to use drupal views to access civicrm contact's image
April 07, 2015, 07:17:00 pm
Looks like something like this is enabled with 4.6.0

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: how to use drupal views to access civicrm contact's image
April 07, 2015, 08:10:15 pm
care to flesh out your comment a bit more for others (and my) benefit?
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

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: how to use drupal views to access civicrm contact's image
April 07, 2015, 08:35:41 pm
@Pete - in 4.6.x thanks to CRM-14491 Add civicrm_handler_field_contact_image to Views implementation, CiviCRM images are exposed to Views natively (but note StackOverflow question Problems with the new (4.6.0) Drupal views image handler for CiviCRM contact images which suggests there may be issues with it).

@kennedy, @groston - Using Drupal image styles / imagecache was discussed recently in How to use Drupal image styles with a civicrm custom field (type file), but the responses there probably are written before the addition of CiviCRM image URLs in 4.6.0, and IDK if the images are natively available for use with image styles yet.
« Last Edit: April 07, 2015, 08:38:27 pm by Chris Burgess »
@xurizaemon ● www.fuzion.co.nz

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • how to use drupal views to access civicrm contact's image

This forum was archived on 2017-11-26.