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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Drupal views2 / showing file (image) from custom data
Pages: [1]

Author Topic: Drupal views2 / showing file (image) from custom data  (Read 936 times)

veelineen

  • Guest
Drupal views2 / showing file (image) from custom data
August 09, 2009, 06:14:41 am
Drupal 6.13
Civicrm 2.2.8
No synchronisation between drupal users and civicrm contacts.

I wanted to add a picture to a civicrm contact. I added a custom field 'file'. The picture is showing up in civicrm.
I created a view with drupal views2 to show some of my contacts.
I want to show the picture there as well. How do I do this?

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: Drupal views2 / showing file (image) from custom data
August 09, 2009, 06:23:41 am

you will need to expand the views integration code to deal with custom fields of type 'file' and allow them to be displayed in views. This will include adding the civicrm_file/civicrm_entity_file to the views integration code 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

veelineen

  • Guest
Re: Drupal views2 / showing file (image) from custom data
August 09, 2009, 10:18:12 am
Found another way to Rome:
Edit your view.
Click on 'information' next to theme.
Look at the field you want to display (for me it was foto_18).  You'll find the template names drupal will look for.
Copy views-view-field.tpl.php from sites/all/modules/views/theme and rename it to one of the names drupal is mentioning (in my case: views-view-field--foto-18.tpl.php).
Open the file, do a query in there to show the picture. Upload to your theme directory and click 'rescane template files' at the view-theme information page.
This way I show my picture and at the same time with the right CSS attached to it.

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: Drupal views2 / showing file (image) from custom data
August 09, 2009, 06:44:50 pm

cool. thanx for sharing the recipe :)

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

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: Drupal views2 / showing file (image) from custom data
August 10, 2009, 02:14:55 am
which might be a good point to ask if the collective wisdom that if we are wanting to be able to have user profiles in drupal including the uploaded image - is it better to think about uploading the image via drupal rather than via civicrm - and if the goal is to enable photo uploading at time of registration (which civi doesn't allow if my memory is correct) then is it likely to be less work to have a registration process that uses some civicrm and some cck fields (for photo upload eg) or to extend civicrm to we can enable photo upload as part of rego??
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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Drupal views2 / showing file (image) from custom data

This forum was archived on 2017-11-26.