Question

How to display an image stored in civicrm database in Drupal views? I have a webform through which user registers and details are stored in civicrm db. I have created a view which displays the user data but when it comes to images it only displays URL of image. Is there a way to display image also

Was it helpful?

Solution

The civicrm image field is a url. To make it display as an image you will need to surround it with an <img> tag using the "rewrite" option in views. In your view click on the field and check "Rewrite the output of this field" Enter this text: <img src="[image_URL]" alt="Contact Image" style="max-width: 200px" /> The "alt" and "style" attributes are optional and you can set max-width to whatever you want (but if you omit it the images will all be the uploaded size).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top