I'm using webform_multiple_file. To display my submissions, I created a view and added as field Webform submission data: Value

To customize my view I used print $fields['value_1']->content ;

This displays somthing like this:



But I want to display just the first data and as an image like

<img src="image1.png" />

Below the HTML return

<div class="webform-multiple-file"><a href="http://localhost/mydrupal/sites/default/files/webform/image1.png">image1.png</a></div><div class="webform-multiple-file"><a href="http://localhost/mydrupal/sites/default/files/webform/image2.jpeg">image2.jpeg</a></div>

Any idea please? Thank you


Try something like this:

file_dir  = $file_create_url("public://");

print '<a href=' . $file_dir . '/'. $fields['value_1']->content . '</a>';
  • Thanks Sir. I edited my question to add the html returns by using $fields['value_1']->content – A.Sana Mar 12 '18 at 16:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.